Reputation: 9
Fisc | 20-21 | 21-22 | 22-23 | 23-24 | 24-25 |
---|---|---|---|---|---|
A | 10 | 15 | 30 | 25 | 5 |
B | 100 | 85 | 35 | 15 | 30 |
this is the initial table imported from Excel in Power Bi :
Table name : prog
I want to create a measure to calculate the difference between rows to display a table like the Following:
20-21 | 21-22 | 22-23 | 23-24 | 24-25 | |
---|---|---|---|---|---|
Diff B-A | 90 | 60 | 5 | -10 | 25 |
this is what i used but doesn't work :
_DiffB-A =
CALCULATE(
SUM('prog'[B]) - SUM('prog'[A]),
ALL('prog'[Fisc])
)
I tried to use the index but all solution are adding a new column and not a row.
Thanks.
Upvotes: 0
Views: 258
Reputation: 2482
you can try this
then create a measure
Measure = CALCULATE(sum(prog[Value]),prog[Fisc]="B")- CALCULATE(sum(prog[Value]),prog[Fisc]="A")
Upvotes: 1