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
patkang
Helper I
Helper I

Summary of duration "hh:mm:ss" total value

Hi everyone, I am still a novice in PBI and have run into some issues with the duration. 

I am trying to aggregate the amount of time spent per user on a learning platform. 

I formated the the data already into duration in the query editor

patkang_0-1607506248387.png

In the report tab, I used the following DAX expression to summarize the time spent per user in total 

Total Duration = FORMAT(SUM('TABLENAME'[DURATION-HMS]),"hh:mm:ss")
PBI.JPG
Now it shows me the correct aggregation per user, but the grand total is not correct. 

Thanks in advance, I appreciate your help!

 
1 ACCEPTED SOLUTION
patkang
Helper I
Helper I
3 REPLIES 3
Fowmy
Super User
Super User

@patkang 

It should work for your total as well, what is the expected total?

If you can share some sample data, I will be able to check it out.

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy I ended up using this code, as I had a separate column that showed me the total duration in seconds.

 

Total Duration = VAR TotalSeconds= SUM('UserActivity simple'[DURATION]) 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((Hors + (Days*24))<10,"0"&(Hors + (Days*24)),(Hors + (Days*24)))&":"&IF(Mins<10,"0"&Mins,Mins)&":"&IF(Secs<10,"0"&Secs,Secs)

 

Its weird since it seems not to work with the column that displays duration. How would you like me to share the sample data? 

patkang
Helper I
Helper I

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.