Forum Discussion
Syndicate_Admin
4 years agoAdministrator
Converting Decimal Hour to HH:MM Format
Hi All, I am trying to convert a column which has value stored as decimal hour to hh:mm format. For eg: 2.78 - 02:46 25.56 - 25:33 Also attached a pbix file for reference. Quick help will b...
- 4 years ago
Try this column
Column = VAR _hours = INT('Table'[TIMEDECHOURS]) VAR _minutes = ROUND(('Table'[TIMEDECHOURS]-_hours)*60,0) RETURN RIGHT("0"&_hours,2)&":"&_minutesWith above code, the column is of Text type. If the hours part is larger than or equal to 100 hours, it would return an incorrect value. You need to modify the hours part in that case. And I used ROUND function for minutes part. You could replace it with ROUNDUP or ROUNDDOWN if needed.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Syndicate_Admin
4 years agoAdministrator
@Syndicate_Admin I couldn't find any attachment. It would be great if there is a DAX formula to resolve this. Is there any possibility to get a calculated column which displays the decimal hours in hh:mm format.
Thanks again