Forum Discussion

Peavey's avatar
Peavey
Icon for Helper III rankHelper III
5 years ago
Solved

Show 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       ...
  • v-henryk-mstf's avatar
    v-henryk-mstf
    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,
    Henry

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.