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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.