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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors