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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NiekHacquebord
Frequent Visitor

Summing time values in a table

Hi all,

 

I am relatively new to Power BI and need help with the following:

I have a dataset in Excel that shows me why a machine was malfunctioning. For each malfunction, I have the reason for malfunctioning ("Reason), a starting time ("Van"), and an ending time ("Tot"). Based on those times, I calculate the duration in Excel as "Tot" minus "Van". The duration is of data type "time" (hh:mm:ss). See also the screenshot below.

data.PNG

 

I would like to produce a visual that aggregates the total malfunction time for each "Reason" (as in a PivotTable in Excel). In other words, for above screenshot, the resulting table would need to show this:

 

NiekHacquebord_0-1628589975092.png

 

 

However, when I try to do that with a table visual in Power BI, this is what I get as a result. Does anyone know how to resolve this?

NiekHacquebord_1-1628590194517.png

Thanks in advance!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @NiekHacquebord 

You need to  create a measure to replace you original column field as below:

 

Measure_Duration = SUM('Table'[Duration])

 

Then change the format of measure as below:

51.png

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi,  @NiekHacquebord 

You need to  create a measure to replace you original column field as below:

 

Measure_Duration = SUM('Table'[Duration])

 

Then change the format of measure as below:

51.png

Best Regards,
Community Support Team _ Eason

Thanks a lot for your solution, I managed to fix it with your help!

Greg_Deckler
Super User
Super User

@NiekHacquebord You will need to convert those durations to seconds, add them and essentially convert them back more or less. Look at the links below, they should get you what you need.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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