Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
maurcoll
Helper II
Helper II

adding leading zeros

Good Morning

Is there a way to add leading zeros to an existing field to make it a five digit number but keeping it as type number.

All of the solutions i have seen convert it to a text field but i need it to remain as a number.

For example

1234 becomes 01234

 

Thank you

1 ACCEPTED SOLUTION
nirali_arora
Resolver II
Resolver II

In the power query editor, choose the custom column from add column tab

In the custom column formula, write the mentioned formula 

Text.PadStart(Text.From([YourExistingField]), 5, "0")

It will not change the type to text.

View solution in original post

2 REPLIES 2
nirali_arora
Resolver II
Resolver II

In the power query editor, choose the custom column from add column tab

In the custom column formula, write the mentioned formula 

Text.PadStart(Text.From([YourExistingField]), 5, "0")

It will not change the type to text.

Ahmedx
Super User
Super User

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.