Forum Discussion
joyce23
6 years agoFrequent Visitor
DEcimal to Time format
How to convert decimal to time format? I searched in all the queries however i dont see the same scenario as mine. Ex. 9:00 converted in decimal by Power BI is 0.375. Now how can i convert 0.365 ...
- 6 years ago
Try this:
Measure = VAR time = SUM(Summary[NewLoginTime])/Summary[EmployeeName Count]) VAR hours = ROUNDDOWN(24 * time ; 0) VAR H_rem = 24 * time - ROUNDDOWN(24 * time ; 0) VAR minutes = ROUNDDOWN(60 * H_rem ; 0) VAR M_rem = 60 * H_rem - ROUNDDOWN(60 * H_rem ; 0) VAR seconds = ROUND(60 * M_rem ; 0) Return TIME(hours;minutes;seconds)
Remember to also change the format to HH:MM:SS:
joyce23
6 years agoFrequent Visitor
Hi tex628,
Mine is not from a column. It is from a measure or formula.
Ave Time = SUM(Summary[NewLoginTime])/Summary[EmployeeName Count]
Regards,
Joyce
tex628
6 years agoCommunity Champion
Try this:
Measure =
VAR time = SUM(Summary[NewLoginTime])/Summary[EmployeeName Count])
VAR hours = ROUNDDOWN(24 * time ; 0)
VAR H_rem = 24 * time - ROUNDDOWN(24 * time ; 0)
VAR minutes = ROUNDDOWN(60 * H_rem ; 0)
VAR M_rem = 60 * H_rem - ROUNDDOWN(60 * H_rem ; 0)
VAR seconds = ROUND(60 * M_rem ; 0)
Return
TIME(hours;minutes;seconds)
Remember to also change the format to HH:MM:SS: