Power Query Problems

Combine Monthly Excel Data and Sum Hours by ID with Power Query

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Combine monthly reports with varying IDs and calculate maintenance team hours for each ID.

Combine Monthly Excel Data and Sum Hours by ID with Power Query
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
Monthly worksheets or files contain maintenance hours for different IDs and need to feed a consolidated totals sheet.
Observed behavior
The desired summary includes every ID from the combined reports and sums hours for each maintenance team.
Before you start

Check that each monthly report identifies the ID and team-hour columns, and decide how to record the month. Use consistent ID formatting and numeric hour values across reports.

Solution 1Recommended

Append monthly reports in Power Query and summarize hours in a PivotTable

Use this approach to build a refreshable source that includes IDs from all imported monthly reports.

1
Prepare each monthly table

On each worksheet, select the report data and choose Insert > Table. Make sure each table has consistent headers, such as ID, Team A hours, and Team B hours.

2
Import the tables

Select each table and choose Data > From Table/Range. In Power Query, rename columns as needed, set consistent data types, and add a Month column through Add Column if the source does not already have one.

3
Append the queries

In Power Query, choose Home > Append Queries > Append Queries as New. Select the monthly queries, confirm the combined rows and columns, and choose Home > Close & Load to load the result as a table.

4
Create the totals sheet

Select the combined table and choose Insert > PivotTable. Place ID in Rows and Team A hours and Team B hours in Values, setting each value field to Sum if necessary.

5
Refresh and add new months

Choose Data > Refresh All after existing source data changes. For a new monthly worksheet, import it as another query, open the combined query from Data > Queries & Connections, and use Home > Append Queries to add the new query before refreshing.

Append monthly reports in Power Query and summarize hours in a PivotTable
Calculate a combined total: If team sums appear in cells B2 and C2, use =B2+C2 in a separate summary column. A PivotTable may also show row grand totals when they are enabled.
Summarize monthly hours in WPS

Combine monthly hours by ID in WPS Spreadsheets

Use WPS Spreadsheets to consolidate monthly rows manually and summarize team hours in a PivotTable. This provides the totals without using Excel Power Query.

  1. 1. Open the reports: Open the monthly Excel files in WPS Spreadsheets and check that their ID and team-hour columns use matching headers.
  2. 2. Combine the rows: Create a worksheet with Month, ID, Team A hours, and Team B hours as headers. Copy and paste each month's data beneath those headers, adding the month to each row.
  3. 3. Insert a PivotTable: Select the combined data range and choose Insert > PivotTable. Place ID in Rows and both team-hour fields in Values, using Sum for each field.
  4. 4. Update the summary: When another month is available, paste its rows into the combined sheet. Update the PivotTable's data source to include the new rows if needed, then refresh the PivotTable.
Sum maintenance team hours for each ID in a PivotTableOpen and edit Microsoft Excel XLSX and XLS filesAdd monthly rows to a single source sheetUse familiar spreadsheet tools to build a totals sheet
QA img-9

Frequently Asked Questions

How do I include IDs that appear in only one month?

Append all monthly queries before creating the PivotTable. Put ID in the Rows area so the summary can list IDs from any of the combined reports.

Why are team hours being counted instead of summed?

Check that the hour columns contain numbers and have a numeric data type in Power Query. In the PivotTable, open Value Field Settings for each hour field and select Sum.

Will Refresh All automatically include a new monthly worksheet?

Not if the combined query references only the existing monthly queries. Import the new worksheet as a query and append it to the combined query, then select Data > Refresh All.

How can I keep leading zeros in IDs?

Format IDs consistently as text in the source and set the ID column to Text in Power Query. If leading zeros were already removed from the source values, restore them before combining the reports.