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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.