Forum Discussion
SSS
8 years agoHelper I
Difference between two rows
Hi, I need help in order to solve a problem trying to calculate the differences between two rows in Power BI. My tables look like: Date Orders Index 01/01/2017 85...
- 8 years ago
Hi SSS
Using DAX you can add this calculated column to get desired results
= VAR NextIndex = Table1[Index] + 1 RETURN Table1[Orders] - CALCULATE ( VALUES ( Table1[Orders] ), FILTER ( ALL ( Table1 ), Table1[Index] = NextIndex ) )
Zubair_Muhammad
8 years agoCommunity Champion
Hi SSS
Using DAX you can add this calculated column to get desired results
=
VAR NextIndex = Table1[Index] + 1
RETURN
Table1[Orders]
- CALCULATE (
VALUES ( Table1[Orders] ),
FILTER ( ALL ( Table1 ), Table1[Index] = NextIndex )
)Anonymous
3 years agoNot applicable
Hi Zubair,
Is there a way to do this in measure instead of calculated column? My situation is that I need to calculate the average of these differences. But my table changes every time user changes the filter in the visual. So creating one calculated column from a fixed table won't work for me. Thanks in advance!