- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Cumulative Total for timestamp
Hi Guys.
I have the following situation. I need to get the cumulative based on every hour. My table has time stamp with seconds / minutes, however, my target is for a 12 hour mark. I can divide the total benchmark by 12 and apply a running sum formula, but that does a running sum based on every time stamp. I would like this running sum to be based on every hour:
Ideally, I'd like this red line to start from 3635 (43626 / 12) at 6:00PM, incrementing by 3635 every hour and at 6:00AM it should give 43626
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @azakir ,
I create a table as you mentioned.
Then I create some calculated columns and measures.
Here are calculated columns DAX codes:
Hour = HOUR('Table'[Timestamp])
HourlyBin =
'Table'[Timestamp]
- SECOND ( 'Table'[Timestamp] ) * ( 1 / 86400 )
- MINUTE ( 'Table'[Timestamp] ) * ( 1 / 1440 )
IncrementPerHour = DIVIDE(43626,12)
Here are measures DAX codes:
TargetRunningSum =
VAR StartTime = TIME(18,0,0)
VAR CurrentTime = MAX('Table'[HourlyBin])
VAR _Incremental = MAX('Table'[IncrementPerHour])
RETURN
IF(CurrentTime >= StartTime,
(DATEDIFF(StartTime, CurrentTime,HOUR)+1) *_Incremental ,
BLANK()
)
CumulativeSum =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
'Table'[HourlyBin] <= MAX('Table'[HourlyBin])
)
)
Finally when you add columns you want, you will see what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @azakir ,
I create a table as you mentioned.
Then I create some calculated columns and measures.
Here are calculated columns DAX codes:
Hour = HOUR('Table'[Timestamp])
HourlyBin =
'Table'[Timestamp]
- SECOND ( 'Table'[Timestamp] ) * ( 1 / 86400 )
- MINUTE ( 'Table'[Timestamp] ) * ( 1 / 1440 )
IncrementPerHour = DIVIDE(43626,12)
Here are measures DAX codes:
TargetRunningSum =
VAR StartTime = TIME(18,0,0)
VAR CurrentTime = MAX('Table'[HourlyBin])
VAR _Incremental = MAX('Table'[IncrementPerHour])
RETURN
IF(CurrentTime >= StartTime,
(DATEDIFF(StartTime, CurrentTime,HOUR)+1) *_Incremental ,
BLANK()
)
CumulativeSum =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
'Table'[HourlyBin] <= MAX('Table'[HourlyBin])
)
)
Finally when you add columns you want, you will see what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @v-yilong-msft This has resolved the issue. Thank you for explaining in such a detail.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
01-31-2025 06:00 AM | |||
12-09-2024 06:53 AM | |||
08-05-2024 02:39 PM | |||
12-17-2024 02:05 PM | |||
04-25-2024 03:48 AM |
User | Count |
---|---|
84 | |
78 | |
52 | |
38 | |
35 |
User | Count |
---|---|
95 | |
72 | |
55 | |
52 | |
46 |