Power Query Problems

How to Find Duplicates Beyond Excel's 1 Million Row Limit Using Power Query

Muhammad TalhaMuhammad Talha Nov 10, 2026 869 views

Question details

The user needs a method to identify duplicate project IDs within a massive dataset of approximately 5 million rows without encountering Excel's maximum worksheet row constraints.

How to Find Duplicates Beyond Excel's Row Limit Using Power Query
Product
Excel
Device & OS
not provided
Scenario
Analyzing and extracting duplicate records from a dataset containing 5 million rows, which is too large to fit or process directly in a standard spreadsheet.
Observed behavior
Excel worksheets have a hard limit of 1,048,576 rows. Attempting to load 5 million rows directly into a worksheet results in truncated data and errors, preventing standard duplicate detection methods.
Before you start

Ensure your 5-million row dataset is saved as an external file, such as a CSV or database connection, so Power Query can process it without opening it in a worksheet.

Solution 1Recommended

Group Data in Power Query and Load to Data Model

Process the data using Power Query's internal engine to count duplicates, and then load the summarized results to the Data Model to avoid worksheet limits.

Power Query can easily process millions of rows in the background. The row limit only applies to the physical worksheet. By filtering the duplicates inside Power Query and loading the final table directly to the Data Model, you completely bypass the 1,048,576-row limitation.

1
Import the Large Dataset

Open a blank workbook, navigate to the Data tab on the ribbon, click 'Get Data', and select your data source (e.g., From Text/CSV or From Database) to import your 5-million row file.

2
Group by Project ID

In the Power Query Editor, click on your Project ID column to select it. Navigate to the Home tab and click 'Group By'.

3
Configure the Grouping Criteria

In the Group By dialog, ensure your Project ID column is selected. Name the new column 'Count', set the Operation to 'Count Rows', and click OK.

4
Filter for Duplicates

Click the filter dropdown arrow on the newly created 'Count' column, select 'Number Filters', and choose 'Greater Than'. Enter 1 to keep only the IDs that appear multiple times.

5
Load to Data Model

Click the arrow below 'Close & Load' and select 'Close & Load To...'. In the Import Data dialog, select 'Only Create Connection' and check the box for 'Add this data to the Data Model'. Click OK.

6
Analyze the Results

Go to the Insert tab, select 'PivotTable', and choose 'From Data Model'. You can now place your duplicate Project IDs and their counts into the PivotTable for review.

Group Data in Power Query and Load to Data Model
Performance Tip: If the resulting list of duplicates is significantly smaller than 1 million rows, you can choose to load the final query directly to a Table in a new worksheet instead of the Data Model.
Free Microsoft Office alternative

Efficiently Handle Your Data with WPS Office

While processing 5 million rows requires advanced database querying, WPS Office is the perfect lightweight alternative for managing standard data, daily reporting, and comprehensive spreadsheet tasks. It is fully compatible with Microsoft Excel formats and provides an intuitive, highly responsive experience for free.

  1. 1. Download and Install: Visit the official WPS Office website to download the free installation package for your operating system.
  2. 2. Open WPS Spreadsheets: Launch the application and open your existing .xlsx or .csv files to immediately begin analyzing your data.
  3. 3. Leverage Built-in Tools: Use WPS Spreadsheets' robust features like PivotTables, advanced filters, and duplicate removal to manage your datasets efficiently.
Seamless format compatibility with Microsoft Excel (.xlsx, .csv).Fast processing times and extremely low system resource usage.Advanced filtering, pivot tables, and professional data visualization tools.Familiar interface allowing for immediate, zero-learning-curve migration.
QA img-9

Frequently Asked Questions

What is the maximum row limit in a standard Excel worksheet?

A standard Excel worksheet is strictly limited to 1,048,576 rows and 16,384 columns. You cannot paste, type, or load data exceeding this limit directly into the visible grid.

Can Power Query handle files larger than 1 million rows?

Yes. Power Query can connect to, filter, and process datasets with tens of millions of rows in its internal engine. The limitation only occurs when you attempt to output that data into the standard worksheet grid.

How do I view data that has been loaded to the Data Model?

Data in the Data Model does not appear in normal spreadsheet rows. To view or interact with it, you must insert a PivotTable or PivotChart based on the Data Model, or open the Power Pivot window from the Data tab.

Why use 'Group By' instead of 'Remove Duplicates' in Power Query?

The 'Remove Duplicates' feature deletes duplicate rows, leaving only unique values. The 'Group By' feature with a count allows you to specifically isolate and view which items are duplicated and how many times they appear in the dataset.