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,
sgross
9 years agoHelper I
Hello v-sihou-msft, thanks for your help. I'm completely new to this, so I could use a little more direction. Are you entering those functions using R Script?
Is there any way to achieve the same effect in the Query Editor? Creating a seperate column with the converted values?