Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Delta between two measures - how to create it?

Dear All, I have a challenge with creating measure which will calculate delta between Emission Per Ton measure. Emission Per Ton = Quantity / Measure per row for filtered period. I would like to...
  • v-lili6-msft's avatar
    6 years ago

    hi  Anonymous 

    Add a rank/index column for 2019,2020Q1 column, then use ALL function to get the previous row measure.

    Try this way as below:

    Step1:

    Add a rank/index column for 2019,2020Q1 column

    Step2:

    Create a difference measure as below:

    Difference = [Emission Per Ton]-CALCULATE([Emission Per Ton],FILTER(ALL('Dim period'),'Dim period'[Index]=MAX('Dim period'[Index])-1))

    Result:

     

    and here is my simple sample pbix file, please try it.

     

    Regards,

    Lin