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 )
)giannicarioni
2 years agoNew Member
Hi, I'm totally new to Power Query and DAX. I need a solution to calculate difference of a value beteen two rows, and tried this one. But when I create a new column and paste the code, I get the error Token Expected:
I can't find a solution to this problem, probably because I don't know DAX fundamentals. Thank you.