Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Add a Leading Zero if Length = 1, else do nothing

Please assist me using Power Query to create a custom column to Add a Leading Zero if Length = 1, else do nothing.

 

 

  • Anonymous Add a custom column:

    if Text.Length([Hours]) = 1 then "0" & [Hours] else [Hours]

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous Add a custom column:

    if Text.Length([Hours]) = 1 then "0" & [Hours] else [Hours]