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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
WanderingBI
Resolver III
Resolver III

Does Excel.Workbook() read the schema of the Excel file ?

Dear all,

 

On the internet I find the information that Power Query will not read the table schema of an imported Excel file when using Excel.Workbook() as an Excel file is unstructured data.

 

https://support.microsoft.com/en-gb/office/add-or-change-data-types-power-query 

 

In Power BI I activated the option -> Global - Data Load -> Type Detection: Never detect column types and headers for unstructured sources.

 

I used the following Power Query code to import the file:

 

 

 

let
    Source = Excel.Workbook(File.Contents(filepath), true),
    Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data]
in
    Sheet

 

 

 

 

I can see that data types are applied to the columns in the table (number, date, ...)

 

Ibanez2000_0-1718248434034.png

 

So my question is if Power Query is automatically detecting the file types according to the values in the table when evaluating Excel.Workbook() or is it reading the types from an Excel schema?

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @WanderingBI ,

 

It's detecting the data types from the first 1,000 row values as default.

I'm unsure on exactly the mechanics it uses i.e. whether it prioritises the earlier row values, or whether it uses the most frequent type over the entire 1,000 rows, but this is the basic method.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @WanderingBI ,

 

It's detecting the data types from the first 1,000 row values as default.

I'm unsure on exactly the mechanics it uses i.e. whether it prioritises the earlier row values, or whether it uses the most frequent type over the entire 1,000 rows, but this is the basic method.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Kudoed Authors