Forum Discussion
Umeshp
7 years agoNew Member
Percentange Difference on selected Years only
Hi all ,
Here is my Question again ,
i am getting year over year % Difference by using Quick measure or Dax calculations. But my question is , if I select years randomly from the slicers it is displaying on the previous year difference only not with the selected years as shown in below images.
everything i need is to calculate the year over year difference on the selected year from slicers , and if all years selected it has to display the previous year difference.
Thanks
Umesh
You may add the following measure.
Measure = VAR y = MAXX ( FILTER ( ALLSELECTED ( Table1[Year] ), Table1[Year] < SELECTEDVALUE ( Table1[Year] ) ), Table1[Year] ) VAR prev = CALCULATE ( [total], Table1[Year] = y ) RETURN IF ( NOT ( ISBLANK ( prev ) ), DIVIDE ( [total] - prev, prev ) )
1 Reply
- v-chuncz-msft
Community Support
You may add the following measure.
Measure = VAR y = MAXX ( FILTER ( ALLSELECTED ( Table1[Year] ), Table1[Year] < SELECTEDVALUE ( Table1[Year] ) ), Table1[Year] ) VAR prev = CALCULATE ( [total], Table1[Year] = y ) RETURN IF ( NOT ( ISBLANK ( prev ) ), DIVIDE ( [total] - prev, prev ) )