Forum Discussion
Anonymous
4 years agoNot applicable
Display Current Selected year vs Previous year
I have data similar to the one below I would like to use a year slicer to control a stacked Column chart. I have one stream that has data from 2020 - 2022 with scores for two subjects Maths & Engl...
- 4 years ago
Hi, Anonymous
Try steps as below:
1.create/enter a seperate table 'Slicer' as below:
Slicer = VALUES('Date'[Year])2. add a measure as below and apply it to visual filter pane
filter control = VAR a = IF ( MAX ( 'Date'[Year] ) = MAX ( Slicer[Year] ) || MAX ( 'Date'[Year] ) = MAX ( Slicer[Year] ) - 1, 1, 0 ) RETURN IF ( ISFILTERED ( Slicer[Year] ), a, 1 )Best Regards,
Community Support Team _ Eason
amitchandak
Super User
4 years agoAnonymous , Please create rank of your AY
a new column
Year Rank = RANKX(all('Date'),'Date'[AY],,ASC,Dense)
Then you can measure like these
This Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])))
Last Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))