Forum Discussion
Delta values
- Anonymous5 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.
Hi Anonymous ,
Here are the steps you can follow:
1. Create calculcated column.
Delta-values =
var _max=MAX('Table'[Date])
var _min=MIN('Table'[Date])
var _1=
CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Date]=_max&&'Table'[ID]=EARLIER('Table'[ID])))
-
CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Date]=_min&&'Table'[ID]=EARLIER('Table'[ID])))
return IF('Table'[Date]=_min,BLANK(),_1)
2. 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.
Thanks Liu,
I followed your steps, and also ended up with a column - however the values seems wrong and does not reflect the expected delta-value as in your example,
Where did I go wrong?