Power Query Problems

How to Group and Merge Rows by Date and Product in Power Query

Steve KSteve K Oct 26, 2026 869 views

Question details

The user needs to consolidate multiple data rows by date and product, summing up specific values into a single row per combination.

How to Group and Merge Rows by Date and Product in Power Query
Product
Microsoft Excel
Device & OS
not provided
Scenario
Organizing and aggregating daily product data from multiple entries into a clean summary table.
Observed behavior
The current dataset contains multiple duplicate rows for the same dates and products, which need to be merged and their corresponding numerical values summed up.
Before you start

Ensure your source data is formatted as an Excel Table and that your date column contains valid date values rather than text to guarantee accurate grouping and sorting.

Solution 1Recommended

Use the Advanced Group By Feature in Power Query

This is the most robust method for consolidating rows based on multiple columns (Date and Product) while summing up other numerical columns.

Using the Advanced option in the Group By feature allows you to define multiple grouping levels, ensuring that combinations of dates and products are kept intact rather than forcing a single product per date.

1
Load Data into Power Query

Select your data table in Excel, go to the Data tab on the ribbon, and click 'From Table/Range' to open the Power Query Editor.

2
Access Group By

On the Home tab or Transform tab within the Power Query Editor, click the 'Group By' button.

3
Configure Advanced Grouping

In the Group By dialog box, select the 'Advanced' radio button. Select 'Date' for your first grouping, click 'Add grouping', and select 'Product' for the second.

4
Set Aggregations

Under the new column names, add aggregations for 'Pieces' and 'Waste'. Choose 'Sum' as the operation from the dropdown and select the respective columns.

5
Close and Load

Click OK to apply the grouping, reorder or rename your columns if necessary, then click 'Close & Load' on the Home tab to output the summarized data back to Excel.

Use the Advanced Group By Feature in Power Query
Easy Data Updates: When new rows are added to the source table in the future, you simply need to right-click the output table and select 'Refresh' to update your merged results.
Free Microsoft Office alternative

Consolidate and Summarize Data Easily with WPS Office

If you are looking for a fast, free alternative to Microsoft Office, WPS Office offers powerful data summarization tools. You can easily group and merge rows by date and product using WPS Spreadsheet's highly compatible PivotTable features without the need for complex queries.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your existing Excel workbook.
  2. 2. Insert a PivotTable: Navigate to the Insert tab, click PivotTable, and select your data range.
  3. 3. Group your data: Drag Date and Product to the Rows area, and Pieces/Waste to the Values area to instantly merge and summarize the data.
100% compatible with Microsoft Excel (.xlsx) and CSV formats.Robust built-in PivotTable functionality for quick data grouping and aggregation.Free, lightweight, and fast installation on all major platforms.Familiar tabbed interface ensures a seamless migration with zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my Power Query grouping returning only one product per date?

This happens if you only grouped by the 'Date' column and extracted the first product instead of adding 'Product' as a distinct second grouping level. To fix this, use the 'Advanced' option in the Group By dialog and ensure both Date and Product are added as grouping levels.

Do I have to use Power Query to group and sum rows in Excel?

No, you do not have to use Power Query. Creating a PivotTable is a quick and straightforward alternative for summarizing and grouping data by multiple columns like Date and Product.

How do I update my grouped data when new rows are added?

If you used Power Query or a PivotTable, simply right-click anywhere on the summarized output table and select 'Refresh'. Ensure your original source data is formatted as an Excel Table so new rows are automatically included in the refresh.

Why are my dates not sorting correctly in the final output?

Dates will not sort chronologically if they are stored as text. Check your source data and ensure the date column is properly formatted as Date values, not Text, before running your query or building your PivotTable.