Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have a column that contains the time as HHMMSS like 120530 for 12:05:30 or 30503 for 03:05:03.
How is it possible to change this to a data type of time?
Solved! Go to Solution.
Input
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
cType = Table.TransformColumnTypes(Source,{{"time", Int64.Type}}),
convert = Table.TransformColumns(cType,{{"time", (x)=> let t = Text.From(x) in List.Accumulate({4,2}, if Text.Length(t) = 5 then "0" & t else t , (s,c)=> Text.Insert(s,c,":"))}}),
out = Table.TransformColumnTypes(convert,{{"time", type time}})
in
out
Output
Input
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
cType = Table.TransformColumnTypes(Source,{{"time", Int64.Type}}),
convert = Table.TransformColumns(cType,{{"time", (x)=> let t = Text.From(x) in List.Accumulate({4,2}, if Text.Length(t) = 5 then "0" & t else t , (s,c)=> Text.Insert(s,c,":"))}}),
out = Table.TransformColumnTypes(convert,{{"time", type time}})
in
out
Output
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 7 | |
| 7 | |
| 6 |