Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ReflexiveCh1p
Contributor
Contributor

Show Year, Month, Week Or Year in a single If

Can any body help me with this?

I want to show Year, Month, Week or Day in a BarChart with a single If expression, but with this code, the dimension chart says "Invalid Dimension" 

=If(Week(max([Fecha OM])) = Week(min([Fecha OM])) And 
    Year(max([Fecha OM])) = Year(min([Fecha OM])),
    [Fecha OM],
    If(Month(max([Fecha OM])) = Month(min([Fecha OM])) And 
       Year(max([Fecha OM])) = Year(min([Fecha OM])),
        Week([Fecha OM]),
        If(Year(max([Fecha OM])) = Year(min([Fecha OM])),
            Month([Fecha OM]),
            Year([Fecha OM])
        )
    )
)

 

Labels (6)
0 Replies