Forum Discussion
sukram1
3 years agoFrequent Visitor
Difference from previous row based on measure
Hi, I am trying to create the difference from the previous row based on a measure. I have the following initial situation: The first two columns are attributes from the dataset. The first m...
Anonymous
3 years agoNot applicable
Hi sukram1 ,
Here are the steps you can follow:
1. Create measure.
Difference =
var _current=
SUMX(
FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])),[Diff_P1/Diff_P2])
var _last=
SUMX(
FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1),[Diff_P1/Diff_P2])
return
IF(
_last=BLANK(),BLANK(),
_current - _last)
2. Result:
If I have misunderstand your meaning, please contact me and provide your desired output.
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