Forum Discussion
Anonymous
4 years agoNot applicable
How to get difference between two columns in Matrix based on slicer selection of Year in Power Bi
- 4 years ago
Hi Anonymous
Here you go https://www.dropbox.com/t/sMyzwonHckNHvdKX
Original Measure code remains the sameMeasure = COUNTROWS ( DISTINCT ('Table'[Value] ) )New Measure code is
Measure1 = VAR MaxYear = MAX ( 'Table'[Year] ) VAR MinYear = MIN ( 'Table'[Year] ) VAR MaxYearValue = CALCULATE ( [Measure], 'Table'[Year] = MaxYear ) VAR MinYearValue = CALCULATE ( [Measure], 'Table'[Year] = MinYear ) VAR Difference = MaxYearValue - MinYearValue VAR Result = SWITCH ( TRUE, NOT HASONEVALUE ( 'Table'[Year] ), Difference, COUNTROWS ( ALLSELECTED ('Table'[Year] ) ) = 1, BLANK(), [Measure] ) RETURN Result
AAspa
1 year agoFrequent Visitor
is there a way to add an additional column with the difference in percentage?
Many thanks