Forum Discussion
sgross
9 years agoHelper I
Converting Decimal Hours to Time Format
Is there a nice easy way to convert decimal hours into hours/minutes in Power BI? A function that essentially does this? For example, turning 3.5 hours into 3 hours and 30 minutes? I've found...
v-sihou-msft
9 years agoMicrosoft Employee
In your scenario, you can take the integer part for Hours and use decimal part to calculate the Minutes. Populate both fields into TIME() function and format them into a time. Please refer to formula below:
Column = FORMAT(TIME(TRUNC(Table1[Column2],0),(Table1[Column2]-TRUNC(Table1[Column2],0))*60,0),"long time")
Regards,
Anonymous
7 years agoNot applicable
Thank you for this, this worked really well.
Is there a way to stop it being a "text" format though as i would like to SUM the output of this.
- Anonymous6 years agoNot applicable
You can also do this in the Query editor:
= Time.Hour([Time])+(Time.Minute([Time)/60)+(Time.Minute([Time])/3600)
No problems with text format.