Forum Discussion
yogevz
7 years agoHelper II
running diff after sum
hi i have to tables, upon them i am creating list which aggregate the measure in a list. i want to create running diff on rows. attach picture.
- 7 years ago
hi, yogevz
After my test, you could use this formula to create a measure as below:
Measure = CALCULATE([Count_student measure])- CALCULATE([Count_student measure],FILTER(ALL(Sheet1),Sheet1[Foreign]=MAX(Sheet1[Foreign])-1))
Count_student measure is a measure which count students.
Result:

Best Regards,
Lin
themistoklis
7 years agoCommunity Champion
Please try the following DAX formula:
DIFFERENCE = var previous = CALCULATE(FIRSTNONBLANK(Table[count_student];Table[count_student]);FILTER(Table;Table[ForeignYear]=EARLIER(Table[ForeignYear]) )) return IF(ISBLANK(previous);0; Table[count_student]-previous)