Forum Discussion
Sum hours
- 10 years ago
Hi,
For example, you have a table like below, the “time” column is date type:
You can create a measure :
Measure = sumx('table', hour('table'[time])) + TRUNC(sumx('table', MINUTE('table'[time]))/60) & ":" & mod(sumx('table', MINUTE('table'[time])), 60) & ":00"
The result is what you want:
Hi,
For example, you have a table like below, the “time” column is date type:
You can create a measure :
Measure = sumx('table', hour('table'[time])) + TRUNC(sumx('table', MINUTE('table'[time]))/60) & ":" & mod(sumx('table', MINUTE('table'[time])), 60) & ":00"
The result is what you want:
Thanks for the solution. It worked fine for me, but I had to make a minor adjustment:
When it resulted rounded hours, the minutes showed up without a leading zero, such as "15:0:00", hence I adjusted it as below.
Duration =
sumx('table', hour('table'[time])) + TRUNC(sumx(Base_Pautas; MINUTE(Base_Pautas[Duração Real]))/60) & ":" &
mod(sumx('table', MINUTE('table'[time])); 60) &
IF(len(mod(sumx(Base_Pautas; MINUTE('table', MINUTE('table'[time])); 60))>1;":00";"0:00")