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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gusdahu
Helper IV
Helper IV

How do I add Leading Zeros?

Power BI Community,

 

I have a data set that includes vendor IDs. Each vendor ID is ten digits long and usually begins with six or seven zeros followed by another digit. See examples below:

 

Vendor ID: 0000001234 or 0000000567

 

Power BI is currently pulling this information  from an excel worksheet. The data within my worksheet is formatted as text. However, when I upload the data into Power BI, the leading zeros are removed and I am left with the numerical values. See examples below:

 

Vendor ID: 1234 or 567

 

I attempted to trouble the following two ways:

 

1) Changed the format of vendor ID to text using the edit query functions. However the data was already formatted as text; and

2) Attempted to created a new column using the dax expression "Vendor ID v2 = FORMAT ([Vendor ID],"0000000000").

 

Neither method worked for me. Any suggestions on how I may add the leading zeroes will be appreciated.

 

Thank you,

Gus Dahu

1 ACCEPTED SOLUTION
Henri-M
Regular Visitor

Hi,

I propose two approaches:
Approach 1: When your data is loaded in power query look on the right side your query settings and DELETE CHANGED TYPE

 

 

Approach 2: Go to Your Power Query

File =>Cuurent File =>Data Load => Type Detection: UNCHECK "Automatically detect colum types and headers for..." and reload your data.

 

Tell me if it's OK.

Thanks

View solution in original post

3 REPLIES 3
Henri-M
Regular Visitor

Hi,

I propose two approaches:
Approach 1: When your data is loaded in power query look on the right side your query settings and DELETE CHANGED TYPE

 

 

Approach 2: Go to Your Power Query

File =>Cuurent File =>Data Load => Type Detection: UNCHECK "Automatically detect colum types and headers for..." and reload your data.

 

Tell me if it's OK.

Thanks

ChrisMendoza
Resident Rockstar
Resident Rockstar

@gusdahu -

 

In the Query Editor you use Text.PadStart.

 

Your #2 works for me to pad with leading.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



ChrisMendoza,

Unfortunately Text.PadStart did not work for me. I ended up changing the text format in the source document and it everything worked out for me. Thank you for your help.

 

Regards,

Gus Dahu

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.