Forum Discussion
Difference between two columns or rows
- 9 years ago
Create a measure called "Difference"
Difference = IF ( HASONEVALUE ( 'Table'[YEAR] ), BLANK (), CALCULATE ( SUM ( 'Table'[AMOUNT] ), FILTER ( 'Table', 'Table'[YEAR] = MAX ( 'Table'[YEAR] ) ) ) - CALCULATE ( SUM ( 'Table'[AMOUNT] ), FILTER ( 'Table', 'Table'[YEAR] = MIN ( 'Table'[YEAR] ) ) ) )Then a measure called "%Inc"
%Inc = DIVIDE ( [Difference], CALCULATE ( SUM ( 'Table'[AMOUNT] ), FILTER ( 'Table', 'Table'[YEAR] = MIN ( 'Table'[YEAR] ) ) ) )Then just shrink the columns in your matrix that have no data so they don't show up, and make sure to turn the row totals on:
Oh and change the formatting/style for the measures as desired.
Create a measure called "Difference"
Difference =
IF (
HASONEVALUE ( 'Table'[YEAR] ),
BLANK (),
CALCULATE (
SUM ( 'Table'[AMOUNT] ),
FILTER ( 'Table', 'Table'[YEAR] = MAX ( 'Table'[YEAR] ) )
)
- CALCULATE (
SUM ( 'Table'[AMOUNT] ),
FILTER ( 'Table', 'Table'[YEAR] = MIN ( 'Table'[YEAR] ) )
)
)Then a measure called "%Inc"
%Inc =
DIVIDE (
[Difference],
CALCULATE (
SUM ( 'Table'[AMOUNT] ),
FILTER ( 'Table', 'Table'[YEAR] = MIN ( 'Table'[YEAR] ) )
)
)Then just shrink the columns in your matrix that have no data so they don't show up, and make sure to turn the row totals on:
Oh and change the formatting/style for the measures as desired.
that worked perfectly for me - thanks a lot for the help :)
But I am still struggling to shrink the columns with the 0 values.
It would be great if someone could help me with that.
Many thanks in advance
- Pfoerster6 years agoHelper III
Hello,
I have build up this table in Power BI:
And the aim should be to get something like this:
So, I need the rows with the differences. How can I do it? In the Source Table, each Value is one column, and the Scenario is also in one single column. Is there any possibility to create this kind of differences?