cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
maurcoll
Frequent Visitor

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors