Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Slicing a Runningtotal by hour with other filters

Hello, I have a runningtotal measure that sums the number of appplications to each hour, per day. 

 

RunningTotal =
CALCULATE(
SUM('FLA'[ApplicationCount])
,FILTER(
ALLSELECTED(FLA),
FLA[Time] <= MAX(FLA[Time])
&& FLA[Date] = MAX(FLA[Date])
)
)
 
This measure accurately filters by state and weekday but not by time. 
For instance when the line graph is filtered by state (CA): 
aaronzheng_0-1639578153086.png

You can see that the runningtotal value for CA when hovered at 12/3/21 7:00PM is 2,179. 

 

However, when 7:00PM is selected for my time slicer: 

aaronzheng_1-1639578295987.png

There is an incorrect value of 154 for CA on 12/3/21. 

 

The X axis of my line graph is: 

AppHourEst =
VAR a =
SELECTEDVALUE(FLA[Time])
RETURN
IF ( a = FLA[Current_Hour_Flag], FLA[ApplicationHourEST], a)
 
The Value of my line graph is the runningtotal measure, mentioned above. 
 
My time slicer value is: 
Time = TIMEVALUE(FLA[ApplicationHourEST])
 
I do not understand why my line graph is filtering down incorrecting by the hour, so any help would be greatly appreciated. 
 
All of the data is from one table, FLA and the sample data can be found here: 

https://docs.google.com/spreadsheets/d/1Ddmx0vcP7t4J1W3l4YgnxYAlXK7ZtRDJ/edit#gid=1127929229

 

Thanks, 

Aaron

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , based on what I got.

 

Create a new date time column and use that

 

Date time = FLA[Date] + FLA[Time]

RunningTotal =
CALCULATE(
SUM('FLA'[ApplicationCount])
,FILTER(
ALLSELECTED(FLA),
FLA[Date time] <= MAX(FLA[Date time])
)
)

 

This should work to reset cumulative daily

 

RunningTotal =
CALCULATE(
SUM('FLA'[ApplicationCount])
,FILTER(
ALLSELECTED(FLA),
FLA[Time] <= MAX(FLA[Time])
&& FLA[Date] = MAX(FLA[Date])
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak, unfortunately that new runningtotal measure seems to be summing up too much. Also it doesn't accurately return the correct value for my test case; filtered to CA and 7:00pm.

aaronzheng_0-1639580937385.png

Thanks for your suggestion, I'll try to experiment more with that idea. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.