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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Forecaster
Regular Visitor

Average Time Not Showing Correctly

Hi everyone 

 

I have a duration column which shows seconds and is a whole number.

 

I can get the average duration by using the formula:

 

avg = AVERAGE(Query1[Duration])

 

 

this gives me an aveage duration of 6570 seconds which is correct.

What I want to do is to convert this to HH:MM:SS

so I tried the following:

 

AvgTime = FORMAT(AVERAGE(Query1[Duration]),"HH:MM:SS")

 

This gives me a time of 00:23:02 which is not correct if you convert 6570 seconds to hours and mins.

 

What am I missing? 

 

Thanks 

1 ACCEPTED SOLUTION
Forecaster
Regular Visitor

I managed to solve this by doing the following:

HHMMSS = 
INT(Query1[avg] / 3600) & ":" &
RIGHT("0" & INT(([avg] - INT([avg] / 3600) * 3600) / 60), 2) & ":" &
RIGHT("0" & MOD([avg], 3600), 2)

View solution in original post

3 REPLIES 3
Forecaster
Regular Visitor

I managed to solve this by doing the following:

HHMMSS = 
INT(Query1[avg] / 3600) & ":" &
RIGHT("0" & INT(([avg] - INT([avg] / 3600) * 3600) / 60), 2) & ":" &
RIGHT("0" & MOD([avg], 3600), 2)
Greg_Deckler
Community Champion
Community Champion

@Forecaster Chelsie Eiden's Duration - Microsoft Power BI Community



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hey, thanks for your reply. I think I need more context here, I don't see how this is solving my issue? 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.