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 Thiago
maybe this thread can help you
http://community.powerbi.com/t5/Desktop/Duration-Troubles/m-p/44560/highlight/true#M17204
Hi Vvelarde! Thanks for the answer!
It didn't work!
I tried to implement, but the result was not expected.
See example below, where the total should be 47 hours and 24 minutes. When I used your code, the result was almost 633 hours!
I believe it has some configuration that I have not learned to use..
HE
01:11:00
02:17:00
02:32:00
01:22:00
05:32:00
04:07:00
03:19:00
06:19:00
00:00:00
05:15:00
00:00:00
02:03:00
00:00:00
02:37:00
01:22:00
03:01:00
00:52:00
00:59:00
00:21:00
02:36:00
01:39:00
47:24:00
- Anonymous10 years agoNot applicable
Seems quite possible there is a better way to do this, but... I do think this will "work"
MyMeasure = 24 * sumx(Table1, round(Table1[MyTime],99))
MyTime was a DateTime type for me (not a string), and I'm just using round to force it into a floating point number (where 1.0 is a full day).