web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Replace (n-1) and (n-2...
Power Apps
Unanswered

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?

Categories:
I have the same question (0)
  • Verified answer
    makabirarif Profile Picture
    14 on at

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard