Forum Discussion

lsihui_'s avatar
lsihui_
Frequent Visitor
1 year ago
Solved

Presenting differences/variances in one table

Hi all, 

 

Have been trying to create a difference/variance on a matrix. The dataset consists of some years with two waves of data (e.g., Wave 1 & 2 of 2019), while others only have one wave (e.g., 2020, 2021). The difference calculation starts to get wrong when I tried to calculate a year with only one wave and one specific wave from another year. Also, I only want to show the difference in the final PBI report.

 

Here is the link to my sample PBI report:  Presenting differences table on PBI.pbix

Kindly advise how I can revise my calculated measure. Thank you!

  • Can you try with difference measure:

     

    Difference =
    VAR Wave1 = CALCULATE(SUM('Table'[Value]), 'Table'[Wave] = "Wave 1")
    VAR Wave2 = CALCULATE(SUM('Table'[Value]), 'Table'[Wave] = "Wave 2")

    RETURN
    IF(NOT(ISBLANK(Wave1)) && NOT(ISBLANK(Wave2)), Wave2 - Wave1, BLANK())

     

     

6 Replies

    • lsihui_'s avatar
      lsihui_
      Frequent Visitor

      Hi rajendraongole1 , 

       

      I am still seeing the value after using your new measure: Property A should be -121 and Property B should be +66 instead. 

       

      • rajendraongole1's avatar
        rajendraongole1
        Super User

        Can you try with difference measure:

         

        Difference =
        VAR Wave1 = CALCULATE(SUM('Table'[Value]), 'Table'[Wave] = "Wave 1")
        VAR Wave2 = CALCULATE(SUM('Table'[Value]), 'Table'[Wave] = "Wave 2")

        RETURN
        IF(NOT(ISBLANK(Wave1)) && NOT(ISBLANK(Wave2)), Wave2 - Wave1, BLANK())