Forum Discussion
differences between rows in matrix
- 6 years ago
Hi oren ,
I created a calculated column to implement it. Please modify the formula based on your data model and have a try.
difference = var a = CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[ID] = EARLIER('Table'[ID])-1)) return IF(a= BLANK(),BLANK(),'Table'[Sales] - a)If the ID column in my sample is not same as yours, you could try to create another column using RANKX to implement.
RANKX = RANKX(FILTER('Table','Table'[Item] = EARLIER('Table'[Item])),'Table'[Sales],,ASC,Dense)Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
i try this - but it didn't work.
i probably need something also for the columns filter..
- v-xuding-msft6 years agoCommunity Support
Hi oren ,
I created a calculated column to implement it. Please modify the formula based on your data model and have a try.
difference = var a = CALCULATE(SUM('Table'[Sales]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[ID] = EARLIER('Table'[ID])-1)) return IF(a= BLANK(),BLANK(),'Table'[Sales] - a)If the ID column in my sample is not same as yours, you could try to create another column using RANKX to implement.
RANKX = RANKX(FILTER('Table','Table'[Item] = EARLIER('Table'[Item])),'Table'[Sales],,ASC,Dense)Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.