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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.