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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
WALEED
Advocate II
Advocate II

Power Query: Force Excel File Import to Use Text Type for All Columns

Gents,

 

My issue is when initially importing; some references like "00" get read as a number and automagically changed to "0". Converting back to text in Power Query won't revert the damage done!

 

I'm using:

Source = Excel.Workbook(File.Contents("B:\BP\Work Exchange\Transformation Power BI\DATA.TR.xlsx"), true, null),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],

I've tried changing the last part of the first line "null" into true/false without success.

I've tried leaving the headers in the first row until a later stage but they still get read as (ABC/123) rather than (ABC) which meddles with my values all the same.

I've tried turning the setting off for auto-detection of types. It still changes the values automatically!

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The excel sheet imported had all its columns changed to "text" type in Excel before importing.

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

When I try and do the same, this is the result after the second step of the query (similar to what you posted), including leading zeroes:

 

Excel text type.png 

 

First at the Changed Type step, the column types are changed to numbers, which can easily be adjusted:

 

Excel text type adjusted.png

 

So if your leading zeroes are already gone at the Navigation step, it looks like something may be wrong in Excel.

Specializing in Power Query Formula Language (M)

View solution in original post

1 REPLY 1
MarcelBeug
Community Champion
Community Champion

When I try and do the same, this is the result after the second step of the query (similar to what you posted), including leading zeroes:

 

Excel text type.png 

 

First at the Changed Type step, the column types are changed to numbers, which can easily be adjusted:

 

Excel text type adjusted.png

 

So if your leading zeroes are already gone at the Navigation step, it looks like something may be wrong in Excel.

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.