Forum Discussion
Anonymous
7 years agoNot applicable
Running Cumulative based on hours
I need your help on a DAX formula to calculate the third column 'CumulativeForTheDay' that's is required to be a running total. The required calculation will be for 24 hours starting at '01:...
Anonymous
7 years agoNot applicable
Hi Anonymous,
I add a condition to summarize yesterday total on 12am, you can use following measure if it works for your requirement:
RunningTotal 2 =
VAR currDate =
MAX ( Daily_Methane_1[TimeStamp] )
RETURN
IF (
TIMEVALUE ( currDate ) <> TIME(0,0,0),
CALCULATE (
SUM ( Daily_Methane_1[FlowAtGivenInterval] ),
FILTER (
ALLSELECTED ( Daily_Methane_1 ),
AND (
Daily_Methane_1[TimeStamp] >= DATEVALUE ( currDate ),
Daily_Methane_1[TimeStamp] < currDate
)
)
),
CALCULATE (
SUM ( Daily_Methane_1[FlowAtGivenInterval] ) + 0,
FILTER (
ALLSELECTED ( Daily_Methane_1 ),
DATEVALUE ( Daily_Methane_1[TimeStamp] )
= DATEVALUE ( currDate ) - 1
)
)
)
Regards,
Xiaoxin Sheng
Anonymous
7 years agoNot applicable
Many thanks in advance Xiaoxin, I'll test it and let you know.