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
slepre
Frequent Visitor

How to Format a duration (in seconds) in DD:HH:MM using a DAX measure

Hi All,

 

I needed to display a large number of seconds (duration) in a comprehensive format.

The below measure is working great:

 

duration_hh = int(sum(events[duration_sec])/(60*60*24)) & " Days, " & mod(int(sum(events[duration_sec])/(60*60)),24) & " hours and " & mod(int(sum(events[duration_sec])/60),60) & " minutes"

 

and to display the below in a card:

slepre_0-1625117400811.png

ttx = format(sum([duration_sec]),"#,###") & " seconds = " & [duration_hh]

 

Enjoy,

./Steph

1 ACCEPTED SOLUTION
slepre
Frequent Visitor

Hi All,

 

As you should have read, I was just sharing this measure with the community.

Not asking for support.

Thanks anyway 🙂

./Steph

View solution in original post

4 REPLIES 4
slepre
Frequent Visitor

Hi All,

 

As you should have read, I was just sharing this measure with the community.

Not asking for support.

Thanks anyway 🙂

./Steph

v-luwang-msft
Community Support
Community Support

Hi @slepre ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it. 

 

 

Best Regards
Lucien

v-luwang-msft
Community Support
Community Support

Hi @slepre ,

Out put is below,what else you want to get?

vluwangmsft_0-1625736720721.pngvluwangmsft_1-1625736737483.pngvluwangmsft_2-1625736751458.png

 

 

Best Regards

Lucien

 

amitchandak
Super User
Super User

@slepre , measure ttx seem fine. I checked #,### work as a format and I am able to display it on card

 

What is the current output and how it is different from the expected one. 

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

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.