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.
I have corrected the measure and solved the error but the visual result is not as expected. Any ideas?
You need to put Zone in the rows, Year in the column, and Amount, Difference and %Inc as values.
- Raul9 years agoPost Patron
Hello dkay84_PowerBI!
I have one problem with shrink the columns in a matrix visualization. I create this visualization:
When I show the matrix like this, shrink the columns with values to 0:
and I refresh the data, the shrink columns are displayed again.
Is there any solution to avoid this?
Thank you.
- Anonymous7 years agoNot applicable
Hi did you fix this issue?