Forum Discussion
LFM
Helper III
2 years agoCalculating previous days values
Im trying to calculate previous days exposure for the measure called "prevous days exposure_mwh". It should be the sum of exposure for the last day. I dont get any values as seen in the pictures. Wha...
- 2 years ago
LFM You are using CALCULATE and TI functions is what is primarily wrong. Do this instead:
Measure = VAR __Date = MAX('NPOSC'[date]) - 1 VAR __Table = FILTER( ALL('NPOSC'), [date] = __Date ) VAR __Result = SUMX( __Table, [exposure_mwh] ) RETURN __Result
Greg_Deckler
Community Champion
2 years agoLFM You are using CALCULATE and TI functions is what is primarily wrong. Do this instead:
Measure =
VAR __Date = MAX('NPOSC'[date]) - 1
VAR __Table = FILTER( ALL('NPOSC'), [date] = __Date )
VAR __Result = SUMX( __Table, [exposure_mwh] )
RETURN
__Result