This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hi all!
I have a column that shows me the time of the day but without leading zeros:
For instance:
How can I change this within power query?
Thanks in advance
Solved! Go to Solution.
Hi @joshua1990 ,
Add a new custom column like this:
let _time = Text.PadStart(Text.From([time]), 6, "0") in
Text.Combine(
{
Text.Start(_time, 2),
Text.Middle(_time, 2, 2),
Text.End(_time, 2)
}, ":"
)
Working example query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlKK1QGSBgbGBmCWsamZAYRlaWRuaghmGRoamRqbKMXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [time = _t]),
chgToInteger = Table.TransformColumnTypes(Source,{{"time", Int64.Type}}),
addTimeFormatted = Table.AddColumn(chgToInteger, "timeFormatted", each
let
_time = Text.PadStart(Text.From([time]), 6, "0")
in
Text.Combine(
{
Text.Start(_time, 2),
Text.Middle(_time, 2, 2),
Text.End(_time, 2)
}, ":"
)
)
in
addTimeFormatted
Example output:
Pete
Proud to be a Datanaut!
Hi @joshua1990 ,
Add a new custom column like this:
let _time = Text.PadStart(Text.From([time]), 6, "0") in
Text.Combine(
{
Text.Start(_time, 2),
Text.Middle(_time, 2, 2),
Text.End(_time, 2)
}, ":"
)
Working example query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlKK1QGSBgbGBmCWsamZAYRlaWRuaghmGRoamRqbKMXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [time = _t]),
chgToInteger = Table.TransformColumnTypes(Source,{{"time", Int64.Type}}),
addTimeFormatted = Table.AddColumn(chgToInteger, "timeFormatted", each
let
_time = Text.PadStart(Text.From([time]), 6, "0")
in
Text.Combine(
{
Text.Start(_time, 2),
Text.Middle(_time, 2, 2),
Text.End(_time, 2)
}, ":"
)
)
in
addTimeFormatted
Example output:
Pete
Proud to be a Datanaut!
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 3 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 3 | |
| 3 | |
| 3 |