Forum Discussion
Running Cumulative based on hours
Hello Xiaoxin,
Thanks for your time. Your code is very close to what I need, it just need to provide a value at '01:00' AM as highlighted in the screenshot which will be the same value from the 'FlowAtGivenInterval' column - 78.66 - in this specific date. You can also notice that no value is available at midnight which I want its value to be accounted and included for the cumulative for this day.
Thanks again for your help.
Emad
Hi Anonymous,
Can you please provide some sample data so that we can test and modify dax formula in power bi side?
Regards,
Xiaoxin Sheng
- Anonymous7 years agoNot applicable
Hello Xiaoxin,
Would you please share your email so I can send you a sample file as it looks like I can't upload it here.
Thanks,
Emad
- Anonymous7 years agoNot applicable
- Anonymous7 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