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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Jumper
Helper I
Helper I

Column format not pulling through correctly from Excel source

Hi.  I've got a data column in an Excel file that is formatted to 000, as it is a detail that needs to be viewed as a three digit code.

 

But when I pull the detail into Power BI, any leading zeros seem to be getting dropped off.  

Jumper_0-1708672308109.png

 

These three digit codes are alpha-numeric, so the column has imported as a general format.  Unfortuantely without the leading zero, the codes are not ordering as expected, nor are they sticking to the three digit format that is necessary.

 

 

Any suggestions how to fix?

2 REPLIES 2
Anonymous
Not applicable

Hi, @Jumper 

When you import Excel data into Power BI, Power BI will automatically identify the data type of each column and set the corresponding type based on your data in each column. You can undo this step in Power Query, and then you can set the data type of each column according to your actual situation.

I have created the following sample data in Excel:

vjianpengmsft_0-1708917688240.png

The results of importing to Power BI are as follows:

vjianpengmsft_1-1708917771601.png

The steps to restore leading zeros are as follows:

vjianpengmsft_2-1708917823275.png

vjianpengmsft_3-1708917859206.png

vjianpengmsft_4-1708917907314.png

vjianpengmsft_5-1708917928274.png

With the above steps you can restore the leading 0's in your columns.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

jolind1996
Resolver II
Resolver II

In Power BI, you can retain leading zeros by converting the column to text format. Use the FORMAT function or concatenate an empty string to the alpha-numeric codes. For instance, use a formula like =FORMAT([Column],"000") or =[Column]&"". This ensures that the three-digit format is maintained and leading zeros aren’t dropped when importing data from Excel. This should help your codes order as expected and maintain the necessary three-digit format. Remember, Power BI treats numbers without leading zeros as numerical data, hence the need for this conversion. I hope this helps! If you have any other questions, feel free to ask.

Best regards,
Johannes

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.