Forum Discussion
Sum hours
- 10 years ago
Some variation of this should work for you, this formula converts the text below into minutes and divides by 60 to get hours.
This is a DAX custom column
=(LEFT([EST Block time],FIND(":",[EST Block time])-1)*60+RIGHT([EST Block time],LEN([EST Block time])-FIND(":",[EST Block time]))*1)/60
If you want it in the format below, you would have to have to do something like:
DAX
Custom Columns
[Hours]=LEFT([EST Block time],FIND(":",[EST Block time])-1)*1
[Minutes]=RIGHT([EST Block time],LEN([EST Block time])-FIND(":",[EST Block time]))*1)*1
Custom Field
Sum:=CONCATENATE(SUM([Hours])+ROUNDDOWN(SUM([Minutes])/60,0),":",MOD(SUM([Minutes]),60))
Just to reassure: Say you'd end up with 48 hours and 45 minutes in total, should the result then be shown as
a) 48:45 or
b) 48:75
or wouldn't: 48.75 be more appropriate, as you're summing hours that will reach well above the standard time-notification, so this would then be the decimal representations of the sum of full hours?
In Excel, there is actually a time format that would deliver exactly the result in a): [h]:mm;@
But this option doesn't seem to be available in Power BI (at least I couldn't find the option to define your own formats).