Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 to hh:mm:ss format. The time i am expecting this time is 8:45:36
Thank you.
Regards,
Joyce
Solved! Go to Solution.
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:
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
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:
Hi @joyce23
Try this:
Ave Time =
FORMAT (
SUM(Summary[NewLoginTime])/Summary[EmployeeName Count],
"HH:MM:SS"
)
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.
Hi @joyce23
If you have the decimal value in a column, it should just be a case of changing the column Data type.
Go to the Data view, the select the Column tools menu.
Column Data type = Decimal number:
Column Data type = Time:
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |