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
i820017
Resolver II
Resolver II

Time Duration Problem

I’m trying to replicate an Excel Report to a Power BI Report that is a time duration. Right now I am not getting the total time duration that I need.

 

Here are two columns from the Excel Report.

i820017_0-1617983826794.png

 

 

Here are two columns from the Power BI Report.

i820017_1-1617983826800.png

 

 

 

The left-hand column is correct because it is a new category that is only a day old. The right-hand column is incorrect because it is not showing the total duration. For example, the entry that says ’14:18:24’ should say ‘134:18:24’. I am using military-time with my calculations.

Does anyone know how I can get Total Time Duration on Power BI?

 

Thanks

Dan

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@i820017 

It is leaving out the hours of the full days, the difference between 134:18:24 and 14:18:24 is 120:00:00 which is 5 days.
If you have the duration in seconds you can convert it to show the whole amount with a measure like this.

 

Full Duration =  
VAR _Seconds = [Duration Seconds]
VAR _Minutes = INT ( DIVIDE ( _Seconds, 60 ) )
VAR _RemainingSeconds = MOD ( _Seconds, 60 )
VAR _Hours = INT ( DIVIDE ( _Minutes, 60 ) )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )

RETURN
    IF (
        NOT ISBLANK ( [Duration Seconds] ),
            FORMAT ( _Hours, "00" ) & ":" & 
            FORMAT ( _RemainingMinutes, "00" ) & ":" & 
            FORMAT ( _RemainingSeconds, "00" )
    )

 

That will return a duration that looks like this:

jdbuchanan71_0-1617985092460.png

 

View solution in original post

2 REPLIES 2
i820017
Resolver II
Resolver II

Your solution worked even though I needed to convert to seconds before I could use the measure that you showed me above...thanks!!!!

jdbuchanan71
Super User
Super User

@i820017 

It is leaving out the hours of the full days, the difference between 134:18:24 and 14:18:24 is 120:00:00 which is 5 days.
If you have the duration in seconds you can convert it to show the whole amount with a measure like this.

 

Full Duration =  
VAR _Seconds = [Duration Seconds]
VAR _Minutes = INT ( DIVIDE ( _Seconds, 60 ) )
VAR _RemainingSeconds = MOD ( _Seconds, 60 )
VAR _Hours = INT ( DIVIDE ( _Minutes, 60 ) )
VAR _RemainingMinutes = MOD ( _Minutes, 60 )

RETURN
    IF (
        NOT ISBLANK ( [Duration Seconds] ),
            FORMAT ( _Hours, "00" ) & ":" & 
            FORMAT ( _RemainingMinutes, "00" ) & ":" & 
            FORMAT ( _RemainingSeconds, "00" )
    )

 

That will return a duration that looks like this:

jdbuchanan71_0-1617985092460.png

 

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.