Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
adi1234
New Member

Convert number to Time

I have a column which is in below whole number format.

Time in hrs
1
3
11
12
23
24

 

I want this to convert it to HH:MM:SS. Is this possible?

3 ACCEPTED SOLUTIONS
manvishah17
Responsive Resident
Responsive Resident

Hi @adi1234 ,
You can created Calculated Column using this 

ConvertedTime =
VAR Hours = CourseEnrollments[CourseID]
RETURN
FORMAT(Hours / 24, "HH:mm:ss")
Screenshot 2024-09-24 151228.png

View solution in original post

suparnababu8
Super User
Super User

Hi @adi1234 

Use TIME dax function to create Calculated Column by using following DAX function.

 

 

   TimeHHMMSS = TIME([Time in hrs], 0, 0)
   

 

 

Go through this Microsoft documentation about TIME dax - https://learn.microsoft.com/en-us/dax/time-function-dax

 

Hope this works for you!

 

View solution in original post

v-cgao-msft
Community Support
Community Support

Hi @adi1234 ,

 

At first you may get a calculated column of date time type, you can modify the data type to time to modify the format to “hh:nn:ss” to get the expected output.

vcgaomsft_0-1727226613229.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum 

View solution in original post

3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @adi1234 ,

 

At first you may get a calculated column of date time type, you can modify the data type to time to modify the format to “hh:nn:ss” to get the expected output.

vcgaomsft_0-1727226613229.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum 

suparnababu8
Super User
Super User

Hi @adi1234 

Use TIME dax function to create Calculated Column by using following DAX function.

 

 

   TimeHHMMSS = TIME([Time in hrs], 0, 0)
   

 

 

Go through this Microsoft documentation about TIME dax - https://learn.microsoft.com/en-us/dax/time-function-dax

 

Hope this works for you!

 

manvishah17
Responsive Resident
Responsive Resident

Hi @adi1234 ,
You can created Calculated Column using this 

ConvertedTime =
VAR Hours = CourseEnrollments[CourseID]
RETURN
FORMAT(Hours / 24, "HH:mm:ss")
Screenshot 2024-09-24 151228.png

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric Community.