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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Marcin
Helper V
Helper V

Running total in time

Hi,

 

I need to get chart with runnig total hours reported in project by weekt time , I am using this  DAX formula :

 

CumulativeHours =
CALCULATE (
SUM ( Events[HoursRound] ),
FILTER ( ALL ( 'Time'[Week] ), 'Time'[Week] <= MAX ( 'Time'[Week] ) )
)

 

But the problem is that in time table I have weeks where there are no hours reported yet for this reason I get chart like first one 

 

Running.png

 

I would like to stop runnig total in courrent week. 

Thanks for help. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Here is my theory:

 

CumulativeHours =
VAR LastEvent = LASTNONBLANK ( Time[Week], CALCULATE ( SUM ( Events[HoursRound] ) ) )
RETURN
  CALCULATE (
    SUM ( Events[HoursRound] ),
    FILTER ( ALL ( 'Time'[Week] ), 'Time'[Week] <= MAX ( 'Time'[Week] ) && 'Time'[Week] <= LastEvent)
   )

View solution in original post

3 REPLIES 3
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

Maybe try wrapping your running total in an IF() statement that checks if the date value is the current week or earlier and if yes, returns your cumulative value, and if not, returns BLANK().

 

An easy way to do this is to add a calc column that checks if the date is => current week and return a Yes or No flag, then use this field in your measure for the filter argument.

 

Also, you could try setting a visual level filter on the chart you have to only show dates up to the current date/week.

Anonymous
Not applicable

Here is my theory:

 

CumulativeHours =
VAR LastEvent = LASTNONBLANK ( Time[Week], CALCULATE ( SUM ( Events[HoursRound] ) ) )
RETURN
  CALCULATE (
    SUM ( Events[HoursRound] ),
    FILTER ( ALL ( 'Time'[Week] ), 'Time'[Week] <= MAX ( 'Time'[Week] ) && 'Time'[Week] <= LastEvent)
   )

That works, thanks a lot for help !

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors