Forum Discussion
Need Help - Converting Seconds to HH:MM:SS and Calculating Average Duration
- 2 years ago
Hi manoj_0911
I can partly help
Create custom columns.
Hours = INT([Seconds] / 3600)Minutes = INT(MOD([Seconds], 3600) / 60)Seconds = MOD([Seconds], 60)Then create anotherDurationFormatted =FORMAT([Hours], "00") & ":" &FORMAT([Minutes], "00") & ":" &FORMAT([Seconds], "00")Hope this helps
Joe
If you found my answer helpful and it solved your issue, please accept as solution
Hi Joe_Barry I appreciate your response, it was really helpful, but I still have some questions. First, my dataset contains 40 durations of this type; given that this is ivr data, can i follow the same approach to convert it to HH:MM:SS? Additionally, for a given average ACW time, I must divide the ACW duration in seconds by the accepted count before converting the result to the hh:mm:ss format. I did this in Tableau; is there a comparable method in Power Bi?" "
AVERAGE ACW TIME = ZN(SUM([ACW DURATION])/SUM([ACCEPTED]))
AVG ACW TIME = IIF([AVERAGE ACW TIME] % 60 == 60,0,[AVERAGE ACW TIME] % 60)// seconds
+ IIF(INT([AVERAGE ACW TIME]/60) %60 == 60, 0, INT([AVERAGE ACW TIME]/60) %60) * 100 //minutes
+ INT([AVERAGE ACW TIME]/3600) * 10000 //hours
"
Without really knowing the data, I would suggest that you find the average before you convert to hh:mm:ss.
Try and test first to see if you get the result you require