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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SAMBWILLANS
Frequent Visitor

Sum of duration over 24 hours

Hi There

im recording course times in PowerBi as time  (hh:mm:ss) however we have a number of course that are now over 24 hours.

 

I had the following in to calculate a sum which worked fine once all courses were under 24 hours but now we have additonal data this is throwing out the sum.

 

sum of duration =
VAR _sum=sum(Dashboard_All_Course_Completion[Duration (HH:MM) for Reporting])*86400
VAR _h=int(_sum/3600)
VAR _m=int((_sum-_h*3600)/60)
VAR _s=int(_sum-_h*3600-_m*60)
return _h

 

 

SAMBWILLANS_0-1667900607157.png

 

Any ideas how I can tackle this?

 

Many Thanks in advance for the help!!!!

 

Sam 

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

There is a special data type dedicated to this kind of calculations. It's called Duration. Both, in Power Query and in DAX.

I've tried changing the data type but this just errors out. Any additional suggestions?

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.