Forum Discussion
Working with time duration
- Anonymous2 years ago
Hi Anonymous
First, you need to convert the hh:mm:ss formatted strings to a total number of seconds to make them easier to sum and average.
Seconds = HOUR([Time]) * 3600 + MINUTE([Time]) * 60 + SECOND([Time])For display purposes, you might want to convert these aggregated durations back to a hh:mm:ss format. You can create a measure to do this. Here's how to convert the total talk time back to a readable format:
TotalTalkTimeFormatted = VAR Total = SUM('Table'[Seconds]) RETURN FORMAT ( DIVIDE(Total, 86400), "hh:mm:ss" )This is the result you want
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
First, you need to convert the hh:mm:ss formatted strings to a total number of seconds to make them easier to sum and average.
Seconds =
HOUR([Time]) * 3600 +
MINUTE([Time]) * 60 +
SECOND([Time])
For display purposes, you might want to convert these aggregated durations back to a hh:mm:ss format. You can create a measure to do this. Here's how to convert the total talk time back to a readable format:
TotalTalkTimeFormatted =
VAR Total = SUM('Table'[Seconds])
RETURN
FORMAT (
DIVIDE(Total, 86400),
"hh:mm:ss"
)
This is the result you want
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.