Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
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)
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)
@Forecaster Chelsie Eiden's Duration - Microsoft Power BI Community
Hey, thanks for your reply. I think I need more context here, I don't see how this is solving my issue?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |