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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors