Forum Discussion
Anonymous
2 years agoNot applicable
Create Matrix column to show % difference between years
I have a matrix in power BI Desktop like the following one (real data deleted due to confidentiality reasons): To build this table I used the following DAX: Valores P&L Cuenta Explo...
- 2 years ago
Hi Anonymous ,
You could try below measure:-
CurrentYearValue = CALCULATE( [Valores P&L Cuenta Explotación], FILTER( ALL('DIM Calendar'), 'DIM Calendar'[Year] = SELECTEDVALUE(Years[Value]) ) ) PreviousYearValue = CALCULATE( [Valores P&L Cuenta Explotación], FILTER( ALL('DIM Calendar'), 'DIM Calendar'[Year] = SELECTEDVALUE(Years[Value]) - 1 ) ) PercentChange = IF( ISBLANK([PreviousYearValue]), BLANK(), DIVIDE([CurrentYearValue] - [PreviousYearValue], [PreviousYearValue], 0) )
Samarth_18
2 years agoCommunity Champion
Hi Anonymous ,
You could try below measure:-
CurrentYearValue =
CALCULATE(
[Valores P&L Cuenta Explotación],
FILTER(
ALL('DIM Calendar'),
'DIM Calendar'[Year] = SELECTEDVALUE(Years[Value])
)
)
PreviousYearValue =
CALCULATE(
[Valores P&L Cuenta Explotación],
FILTER(
ALL('DIM Calendar'),
'DIM Calendar'[Year] = SELECTEDVALUE(Years[Value]) - 1
)
)
PercentChange =
IF(
ISBLANK([PreviousYearValue]),
BLANK(),
DIVIDE([CurrentYearValue] - [PreviousYearValue], [PreviousYearValue], 0)
)