How to Create Multiple Power Query Queries from a Large Text File in Excel
Question details
The user needs to extract data from a 22-million-row text file using Power Query and load the results into multiple separate Excel worksheets because the dataset size exceeds standard worksheet limits.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Importing and segmenting a massive text dataset for analysis in Excel without losing data.
- Observed behavior
- Excel worksheets have a strict limit of 1,048,576 rows, making it impossible to load the entire 22-million-row text file into a single sheet without data truncation.
Ensure you are running a 64-bit version of Office and have sufficient system RAM, as processing multi-million-row datasets in the Data Model is highly memory-intensive.
Load to the Data Model and Create Filtered Referenced Queries
Bypass the worksheet row limit by loading the entire dataset strictly as a connection to the Data Model, then create separate filtered queries to extract smaller chunks into standard worksheets.
By loading your massive text file directly to the Data Model, you avoid Excel's physical worksheet grid limits. Once the master connection is established, you can reference it multiple times to slice the data into manageable pieces.
Open Excel, navigate to the 'Data' tab on the ribbon, click 'From Text/CSV', and browse to select your 22-million-row text file.
In the preview window, click the drop-down arrow next to 'Load' and select 'Load To...'. Choose 'Only Create Connection' and check the box labeled 'Add this data to the Data Model'. Click 'OK'.
Open the 'Queries & Connections' pane on the right side of Excel. Right-click your newly created master connection and select 'Reference' to open the Power Query Editor with a linked query.
Apply filters to your columns (e.g., by date, category, or region) to ensure the resulting dataset contains fewer than 1,000,000 rows.
Click 'Close & Load To...' from the Home tab in the Power Query Editor. Select 'Table' and choose 'New worksheet'. Repeat the reference and filtering process for the remaining data.

Filter Data Directly During the Initial Import
If loading a pure connection for a massive file fails or stalls your system, filter the data in Power Query before completing the initial load to the Data Model.
Discover a Fast and Free Alternative for Your Everyday Spreadsheets
While extreme big-data tasks like processing 22-million rows are uniquely suited for specialized database tools or Excel's Data Model, WPS Office offers a completely free, lightning-fast, and highly compatible suite for your everyday data analysis and spreadsheet tasks. Enjoy a familiar interface without the heavy subscription costs.
- 1. Download the software: Visit the official WPS Office website and click the free download button.
- 2. Install WPS Office: Run the lightweight installer and follow the quick setup wizard.
- 3. Open your Excel files: Launch WPS Spreadsheet and instantly open your existing .xlsx and .csv files to continue working seamlessly.

Frequently Asked Questions
What is the absolute maximum row limit in an Excel worksheet?
An Excel worksheet is strictly limited to 1,048,576 rows and 16,384 columns. If you try to load a dataset larger than this directly into a standard worksheet, Excel will truncate the data and display a warning.
Can I analyze a 22-million-row dataset in Excel without splitting it?
Yes, you can bypass the worksheet row limit by loading the massive dataset exclusively into the Data Model (selecting 'Only Create Connection' and 'Add this data to the Data Model'). From there, you can use Power Pivot or PivotTables to aggregate and analyze the full dataset.
Why does my Power Query connection fail when loading large text files?
Connection failures on massive files often occur due to system memory (RAM) limitations, especially if you are using a 32-bit version of Excel. Upgrading to 64-bit Office or filtering the dataset inside the Power Query Editor before loading it can resolve these stability issues.




