Forum Discussion

Jase71ds's avatar
Jase71ds
Icon for Advocate I rankAdvocate I
5 years ago
Solved

Need to Force a Data Column to Make Numbers into Text in the Form of XX.XX

Hoping for some Power Query assistance. I have a column of reference data that I want to treat as Text, and have it in the form of xx.xx In Excel - I would simply highlight the column, Format/Custo...
  • Jase71ds's avatar
    5 years ago

    Thanks for this. I struggled with it (I'm not the brightest) but to no avail. However, your answer prompted me to success. It's certainly not elegant, but here's what I did...

    Split the column at the "." delimeter.

    Renamed the two new columns, "Half_1" and "Half_2"

    Created 2 custom columns:

    • = Text.PadStart( [Half_1], 2 )
    • = Text.PadEnd( [Half_2], 2 )

    This put a space any time there was not 2 digits

    Then I went and did a Find/Replace " " with "0"

    Then concatenated the two columns: = [Half_1] & "." & [Half_2]

    Long way to do it, but it worked!

    Thanks to all, your post prompted me in a successful direction!

    Jase.