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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LinlookZDJ
Helper I
Helper I

Sum duration column and display in chart

Dear Power BI Experts,

 

I have edited my Time Gap column to duration type but I am unable to sum the duration column in my desktop. There is only count function available, is there anything i have missed out?

 

I would like to create a chart to display the total sum or average of duration for individual machine. 

 

LinlookZDJ_1-1629434272896.png

 

LinlookZDJ_0-1629434248871.png

 

Attached my dashboard and raw files for your reference:

https://drive.google.com/drive/folders/1bobrSCuXLHAm1xeJWCndMAscVgvw_mzJ?usp=sharinghttps://drive.go...

 

Thank you for your time!

 

Best regards

Lin

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @LinlookZDJ,

AFAIK, power bi data model tables do not support duration types and you cant use these types which are not support summarized on chart value fields. (date/time and durations types cannot be aggregate)

For this scenario, I'd like to suggest you convert them to 'total seconds' in whole number type. Then you can simply use them on visual value fields and they will be auto aggregated.

Regards,
Xiaoxin Sheng

View solution in original post

4 REPLIES 4
community_pinki
Helper II
Helper II

Hi @LinlookZDJ ,

 

You cannot take a sum of TimeGap column as it is not a numerical value type column So there's only option to take count and distinct count.

amitchandak
Super User
Super User

@LinlookZDJ , For sum and avg of duration, refer to approach in the blog

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

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

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

Hi, 

 

I wanted to display durations in my charts. However, I haven't figured out how to do it in a proper way.

Currently I'm using a column that represent duration as a decimal number. I have been trying to look at different blogs but doesn't lead me to the correct output. 

 

I have also tried to create a measure using the following code to convert decimal duration and display in dd:hh:mm:ss but still unable create a visual chart. 

 

 decimal08.png

 

Appreciate if you can guide me and give me an example.

 

Thanks!

 

Best regards

Lin

Anonymous
Not applicable

HI @LinlookZDJ,

AFAIK, power bi data model tables do not support duration types and you cant use these types which are not support summarized on chart value fields. (date/time and durations types cannot be aggregate)

For this scenario, I'd like to suggest you convert them to 'total seconds' in whole number type. Then you can simply use them on visual value fields and they will be auto aggregated.

Regards,
Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors