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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
maurcoll
Helper III
Helper III

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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