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
Anonymous
Not applicable

Formating time value

Hi everyone!

I'm looking for a way to convert whole number to time format like this: 

900→9:00

0→0:00

1 ACCEPTED SOLUTION
edhans
Super User
Super User

If you want to use Power Query, you will do this.

Time.From(
 Text.From(
  Number.IntegerDivide([Column1],100)
  ) 
 & ":" & 
 Text.End(
  Text.From([Column1]),
  2)
 )

It will be converted to a legitimate time of 9am assuming that 900 is the integer in Column1

The following in DAX will work on a calculated column.

Column =
TIME( ROUND(
    [Column1] / 100,
    0
), VALUE(
    RIGHT(
        FORMAT(
            [Column1],
            "#"
        ),
        2
    )
), 0 )

None of these solutions assume that the last two digits are always 00. So 945 would be converted to 9:45 both times.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you soooo much!!!

amitchandak
Super User
Super User

@Anonymous ,

new column = time(quotient([column],100),mod([colum],100),0)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
edhans
Super User
Super User

If you want to use Power Query, you will do this.

Time.From(
 Text.From(
  Number.IntegerDivide([Column1],100)
  ) 
 & ":" & 
 Text.End(
  Text.From([Column1]),
  2)
 )

It will be converted to a legitimate time of 9am assuming that 900 is the integer in Column1

The following in DAX will work on a calculated column.

Column =
TIME( ROUND(
    [Column1] / 100,
    0
), VALUE(
    RIGHT(
        FORMAT(
            [Column1],
            "#"
        ),
        2
    )
), 0 )

None of these solutions assume that the last two digits are always 00. So 945 would be converted to 9:45 both times.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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! Prices go up Feb. 11th.

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.