Forum Discussion
Aron_Moore
Solution Specialist
8 years agoDAX Help - Compare to nonexistent row
Hello experts, Trying to build a model that compares inventory levels period to period. Trouble is, when the level goes from 0 (or blank) to X, it doesn't calculate that as an increase. Tried the...
- 8 years ago
Hi Aron_Moore,
Could you try the formula below to see if it works in your scenario? :smileyhappy:
Delta QTY = CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MAX ( 'Calendar'[Date] ) ) ) - CALCULATE ( SUM ( 'Monthly SLoc Value'[Total Q] ) + 0, FILTER ( 'Monthly SLoc Value', 'Monthly SLoc Value'[Date] = MIN ( 'Calendar'[Date] ) ) )Regards
v-ljerr-msft
Microsoft Employee
8 years agoHi Aron_Moore,
Could you try the formula below to see if it works in your scenario? :smileyhappy:
Delta QTY =
CALCULATE (
SUM ( 'Monthly SLoc Value'[Total Q] ) + 0,
FILTER (
'Monthly SLoc Value',
'Monthly SLoc Value'[Date] = MAX ( 'Calendar'[Date] )
)
)
- CALCULATE (
SUM ( 'Monthly SLoc Value'[Total Q] ) + 0,
FILTER (
'Monthly SLoc Value',
'Monthly SLoc Value'[Date] = MIN ( 'Calendar'[Date] )
)
)
Regards
- Aron_Moore8 years ago
Solution Specialist
Ah, good catch. That did it.
Thanks!