Is it possible to use a variable within a DAX measure expression? For example, the following measure isn't working (it always returns 0).
Notice the second variable below is referencing the first:
Measure =
VAR ThisMonth =
CALCULATE (
ABS ( SUM ( 'Table'[Saldo] ) );
FILTER ( Table; Table[Conta] = 71 )
)
VAR PreviouzMonth =
CALCULATE (
ThisMonth;
PREVIOUSMONTH ( 'Calendário'[Date] );
FILTER ( ALL ( 'Calendário'[Mês] ); MAX ( 'Calendário'[Mês] ) > 1 )
)
RETURN
ThisMonth-PreviouzMonth
But if the two variables above are calculated separetely - ie as two different measures - the calculation works fine.
Thanks for supporting!