Forum Discussion
How to Show average Time in HH:MM:SS format
Hi,
i have a column in my table that has data with Duration format as HH:MM:SS. how do i get the average by date or by other data elements on my table. a sample result that i wanted to achieve is the one below.
| Month | Outage Duration (hh:mm:ss) |
| Aug-21 | 1:17:43 |
| Sep-21 | 3:00:00 |
| Oct-21 | 2:33:10 |
| Nov-21 | 0:56:11 |
| Dec-21 | 2:21:50 |
| Jan-22 | 2:00:43 |
| Feb-22 | 3:50:19 |
| Mar-22 | 2:02:02 |
| Apr-22 | 8:58:06 |
| May-22 | 1:49:38 |
| Jun-22 | 1:33:38 |
| Average | 2:45:46 |
Thank you for your feedback on this.
2 Replies
- amitchandak
Super User
Anonymous , You have convert it seconds, Take Avg and again display as HH:MM:SS
New measure =
var _data = average(Table, Hour([Duration]) *3600 + Minute([Duration]) *60 + Second([Duration]) )
return
time(0,0,_date) & ""
- liuqi_pbi
Resolver III
Hi Anonymous
As the Duration data type is not supported in the data model of a Power BI report and the Time data type is for timestamp values not for durations, you need to convert the "HH:MM:SS" format duration values into total seconds for calculating the average, then display the average value in "HH:MM:SS" format. It is recommended to use a measure for this calculation.
These similar threads should be helpful:
Solved: Calculate Average Duration in hh:mm:ss - Microsoft Power BI Community
Solved: Duration data as an average and hh:nn:ss - Microsoft Power BI Community
Hope this helps.