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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors