Forum Discussion
Peavey
Helper III
5 years agoShow deviations in matrix between years
Hi, I want to show deviation between 2 years in a matrix visual. How can I show deviation by subtracting or other good ideas in Desktop PBI? Item 2021 2022 Deviation a ...
- 5 years ago
Hi Peavey ,
Based on the above error, you can create the following measure, replacing the field originally placed in value and the created Diff 2022-2021 measure.
Diff 2022-2021 = IF(HASONEFILTER('Table'[year]),MAX('Table'[amount]),CALCULATE ( SUM ( 'Table'[value] ), FILTER ( ALL ( 'Table'), 'Table'[year] = 2021 ) ) - CALCULATE ( SUM ( 'Table'[value] ), FILTER ( ALL ( 'Table' ), 'Table'[year] = 2022 ) ))
Best Regards,
HenryIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
S_JB
Resolver III
5 years agoThis looks like it could be the data table name in the sample PBIX file that was sent. The DAX references the data table then specificies the measure to use.
Peavey
Helper III
5 years agoSame as I guessed, but I don't seem to understand the DAX here. Can someone please show me in my example what to do? Maybe I get it then 🙂
Thanks
-A-