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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Stabben23
Helper I
Helper I

numbers to time power query

Hi, I have this numbers as my time value and want to format to time value like hh:mm:ss in power query. 

example 113, 1256, 211318, 144036, 2

expected 00:01:13, 00:12:56, 21:13:18, 14:40:36, 00:00:02

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Stabben23 

 


First change the type of your Column to "Text"

Then

Try this custom Column
Change ColName according to your actual Column Name

 

=let 
sec=Text.End([ColName], 2),
min=Text.End(
Text.BeforeDelimiter([ColName],sec),2),
hour=Text.End(
Text.BeforeDelimiter([ColName],min&sec)
,
2)
in 
#time(
    (if hour="" then 0 else Number.From(hour)),
    (if min="" then 0 else Number.From(min)),
    (if sec="" then 0 else Number.From(sec)))

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Stabben23 

 


First change the type of your Column to "Text"

Then

Try this custom Column
Change ColName according to your actual Column Name

 

=let 
sec=Text.End([ColName], 2),
min=Text.End(
Text.BeforeDelimiter([ColName],sec),2),
hour=Text.End(
Text.BeforeDelimiter([ColName],min&sec)
,
2)
in 
#time(
    (if hour="" then 0 else Number.From(hour)),
    (if min="" then 0 else Number.From(min)),
    (if sec="" then 0 else Number.From(sec)))

@Zubair_Muhammad 

Great, It works, Thanks for sharing

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors