Forum Discussion
Anonymous
2 years agoNot applicable
Subtraction in Pivot
Hi,
I have a pivot in Power BI, as usual when we select the subtotal it sums up, something like below.
| 1 | 2 | 3 | 4 | |
| 2024 | 10 | 30 | 45 | 10 |
| 2023 | 5 | 0 | 15 | 6 |
| Total | 15 | 30 | 60 | 16 |
What I want is as below and can any one help me how to do this in power BI
| 1 | 2 | 3 | 4 | |
| 2024 | 10 | 30 | 45 | 10 |
| 2023 | 5 | 0 | 15 | 6 |
| Total | 5 | 30 | 30 | 4 |
Thanks
Am136
2 Replies
- MFelixSuper User
Hi Anonymous ,
If you only have two values for year you can create a measure similar to this one:
Total = IF( ISINSCOPE('Minus Table'[Year]), SUM('Minus Table'[Values]), CALCULATE( SUM('Minus Table'[Values]), 'Minus Table'[Year] = MAX('Minus Table'[Year]) ) - CALCULATE( SUM('Minus Table'[Values]), 'Minus Table'[Year] = MIN('Minus Table'[Year]) ) )If there are more values please let me know because this needs to be adjusted
- AnonymousNot applicable
Hi Miguel,
Thanks for the quick response. So each year has 1,2,3,4 which is nothing but jan, feb, mar... so its going to be till 12 or Dec. and how do you get the Total at the bottom ? when I add the "Total" measure in the value, it goes on the side of 1, 2,3... column.
A