Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi to eveyone! I have a bar chart with years as dimension and some measures. I would show this chart just for the last six years...than I thought that set a condition in a graph it would be fine. Maybe creating a variable
vYear=Max(Year) - 6
or vCurrentYear=year(today())
and setting a condition in the chart someting like:
Year>vYear, or vCurrentYear-6 >Year>vCurrentYear
But these kind of conditions (greater and minus ) seem not work . Do you have any suggestion or maybe another idea to get a chart that shows only last six years? Thanks a lot
You can try something like below expression in your chart
Sum({<Year ={">=$(=max(Year)-6)"}>}Sales)
Using set analysis like @Kushal_Chawda suggested is a good approach. An alternative is to create a custom dimension in your chart replacing your year dimensionnwhit this expression:
=if([Year] > year(today())-6, [Year], Null())
Then make sure to hide null dimension values in your chart.