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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Sum duration?

Hello,

I have a Excel: 

moustafa67_0-1636097548370.png

I want to Sum those durations in Power BI. It should return Hours and Minutes like 12:35h. How can I realize this? What format should I use in Excel? I managed to sum those durations up with a measure but it returns a text value, so it is impossible to make eg. a bar chart. The measure is: 

Zeitaufwand=

VAR TotalSeconds=SUMX('Zeitaufwand Bewirtungen',HOUR('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen])*3600+MINUTE('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen])*60+SECOND('Zeitaufwand Bewirtungen'[Zeitaufwand Delegation/Gruppen]))
VAR Days =TRUNC(TotalSeconds/3600/24)
VAR Hors = TRUNC((TotalSeconds-Days*3600*24)/3600)
VAR Mins =TRUNC(MOD(TotalSeconds,3600)/60)
VAR Secs = MOD(TotalSeconds,60)
return IF(DAYS=0,"",IF(DAYS>1,DAYS&"days ",Days&"day"))&IF(Hors<10,"0"&Hors,Hors)&":"&IF(Mins<10,"0"&Mins,Mins)&":"&IF(Secs<10,"0"&Secs,Secs)
3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

You say you want to return the hour and minute, but the measure contains day, hour, minute, and second. This seems a bit contradictory, and the information you share is not enough for us to modify.

vjaneygmsft_0-1637649269229.png

So can you share some insensitive data samples and your expected output? Then may be we can think of a workaround for you.

 

Best Regards,
Community Support Team _ Janey

amitchandak
Super User
Super User

@Anonymous , There are couple of blogs around that, see if those can help

 

Duration
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx

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
Anonymous
Not applicable

They did not help.

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.

Top Solution Authors
Top Kudoed Authors