Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Query
Answered

Replace (n-1) and (n-2) digit values to n digit value

(0) ShareShare
ReportReport
Posted on by 14

There is a column in which the value must be three digits. Sometimes it has a 1 or a 2 digit value, but in order to make it a 3 digit value, 0 (zero) needs be added at the beginning, like in the following example:

 

001001
2002
03003
Y10Y1
YZ0YZ
XYZXYZ

 

Please advise?

  • Verified answer
    makabirarif Profile Picture
    14 on at
    Re: Replace (n-1) and (n-2) digit values to n digit value

    Got the solution.

    New column = Table.AddColumn(#"Previous Step", "New Colum", each if Text.Length([Column1])=1 then "00"&[Column1] else if Text.Length([Column1])=2 then "0"&[Column1] else [Column1])

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Query

#1
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 7

#3
SD-13050734-0 Profile Picture

SD-13050734-0 6

Overall leaderboard

Featured topics