Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Delta values

Hi,   How would I calculate Delta-values derived from a Date in combination with ID: Date ID Values Delta-values DD-MM-YYYY  12:00 1 88   DD-MM-YYYY  12:00 2 23   DD-MM-YYYY  ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Anonymous ,

    Here are the steps you can follow:

    1. Increase the index through power query

    2. Create calculcated column.

    Delta-values =
    var _lastindex=
    CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),[Metern]=EARLIER([Metern])&&[Index]<EARLIER([Index])))
    
    var _lastdata=
    CALCULATE(SUM('Table'[Data]),FILTER('Table',[Index]=_lastindex))
    
    return IF(_lastindex=BLANK(),BLANK(),[Data]-_lastdata)

    3. Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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