Manage Power Query Type Detection Settings and Row Limits in Excel
Question details
The user wants to understand how Power Query's automatic type detection works, including global settings, the number of rows inspected, and customization options for different file types.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Importing unstructured data using Power Query where automatic type detection might cause unexpected formatting or refresh errors.
- Observed behavior
- Power Query automatically applies data types based on the first 200 rows in Excel (or 1,000 in Power BI). Users cannot define custom row ranges for type detection for most file types.
Review your current Power Query queries to see if automatically generated 'Changed Type' steps are causing errors during data refreshes, particularly with large datasets containing mixed data types.
Adjust Power Query Type Detection Settings
Configure global or workbook-specific settings to control when Power Query automatically detects column types.
Excel allows you to control whether Power Query automatically detects column types and headers for unstructured sources. Disabling this setting can help prevent unexpected refresh errors caused by inconsistent data in larger datasets.
Open Excel, navigate to the 'Data' tab on the ribbon, and click on 'Get Data' followed by 'Query Options'.
In the Query Options window, under the 'Global' section on the left, select 'Data Load'. Here you can change the default type detection behavior for all new workbooks.
To change settings for the active file only, look under the 'Current Workbook' section, select 'Data Load', and choose your preferred type detection setting.
If automatic types are causing errors, select 'Never detect column types and headers for unstructured sources', then click 'OK' to save your changes.

Manually Remove and Apply Data Types in the Query Editor
Remove the automatic type detection step and manually define data types later to gain complete control over your query logic.
Need a Lightweight Excel Alternative? Try WPS Office
If you are dealing with datasets and find Excel's advanced data processing features overwhelming or resource-heavy, consider WPS Office. It provides a lightweight, highly compatible, and completely free spreadsheet solution for your daily data management and analysis needs.
- 1. Download and Install: Download WPS Office from the official website and install it on your device.
- 2. Open Your Data: Launch WPS Spreadsheet and seamlessly open your existing .xlsx or .csv data files.
- 3. Analyze Data Efficiently: Use the built-in 'Data' tab tools like Text to Columns, PivotTables, and advanced filtering for efficient data management.

Frequently Asked Questions
How many rows does Power Query inspect for type detection?
Excel's Power Query generally examines the first 200 rows to determine column data types for unstructured sources, while Power BI Desktop typically inspects the first 1,000 rows.
Can I change the number of rows Power Query inspects for type detection?
Currently, Excel and Power BI do not provide a built-in feature to customize the exact number of rows (e.g., changing 200 to 500) inspected for type detection across most file types.
Why is my Power Query refresh failing due to data type errors?
Refresh errors often occur when the automatic type detection step is based on the first 200 rows, but subsequent rows contain incompatible data (like text in a supposedly numeric column). Removing the automatic 'Changed Type' step and applying data types manually at the end of your query can resolve this.
How do I turn off automatic data type detection for a specific workbook?
Go to Data > Get Data > Query Options. Under the 'Current Workbook' section on the left, select 'Data Load' and choose 'Never detect column types and headers for unstructured sources'.




