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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
HenryJS
Post Prodigy
Post Prodigy

SUM Time Field

Hi all,

 

Is it possible to SUM a Time field?

 

Below I have summed [Rest Time 2] but instead of correctly adding up the times it gives an incorrect time

 

Capture.PNG

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@HenryJS 

 

You cannot get the sum of the time value with Groupby() table because currentgroup() is referring to the current row instead of all(table). 

 

Try use summarize():

Table = Summarize('Engage Timesheet Export',
                  'Engage Timesheet Export'[Worker Name],
                  'Engage Timesheet Export'[Week Ending],
                  "Total Rest Time",Sumx(All('Engage Timesheet Export'),[Rest Time2]))

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@V-pazhen-msft this summarised the rest times and gave the same value for everyone - please see below

 

 

Capture.PNG

@HenryJS 
I guess I misunderstood you requirement. I only see the incorrect sum time. You may add filters to set context.

 

Table = Summarize('Engage Timesheet Export',
                  'Engage Timesheet Export'[Worker Name],
                  'Engage Timesheet Export'[Week Ending],
                  "Total Rest Time",Sumx(All('Engage Timesheet Export'),[Rest Time2]))

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

watkinnc
Super User
Super User

Hey there. I find that when dealing with time, it's always best to use a decimal number for times, instead of actual times; especially when adding and subtracting. My advice would be to change your time column to type number, write the measure, and then change the measure display type to h:mm:ss or if the sum is over 24 hrs, [H]:mm:ss. Should work!


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
amitchandak
Super User
Super User

@HenryJS , refer if these blogs can help

https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageK...

https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-i...

https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.