Power Query Course
Lab 07

Aggregate Columns &
Group by Month

Sum multiple sales columns into a single Total Sales figure, then roll daily transaction dates up into monthly periods using Start of Month and Group By.

~30 minutes
Level: Intermediate
Tool: Microsoft Excel

Concept

Raw transactional data often arrives with sales split across multiple columns — by product line, payment type, or channel — and with timestamps recorded at the day level. Before you can build a useful summary report, you need to do two things: collapse those separate columns into one Total Sales figure, and roll daily dates up into monthly periods.

Power Query handles both efficiently. Add Column → Standard → Add lets you sum selected columns into a new column in one step. Transform → Date → Start of Month normalizes any date to the first day of its month — making all days in January equal, for example — so that a subsequent Group By can aggregate every row in that month into a single summarized record.

Lab File — pq3a.xlsx Create a new query and connect to the DailyManagerSales table inside the file.
Download File
Lab Instructions
Steps Directions
To Start
Create a new query to source File 3A, and fetch the table named DailyManagerSales.
Rename the query.
To Aggregate the Sales Columns into One
Create a summation column of Total Sales. Select 3 sales columns Add Column Standard Add
Rename the new column to Total Sales and delete the other sales columns.
To Group Sales by Month
Identify the month of each row. Select date column Transform Date Month Start of Month
Group the Date column into months, summing Total Sales per month.
Group By
Transaction Date
New column name
Total Sales
Operation
Sum
Column
Total Sales
Select date column Group By Transaction Date
Start of Month before Group By. Group By aggregates rows that share the exact same value. If your dates are still at the day level (e.g. Jan 3, Jan 17, Jan 28), Group By treats each day as a separate group. Transform to Start of Month first so that all January dates become Jan 1 — then Group By collapses them into one monthly row correctly.
Power Query Course · askfarouk.net Ahmed Farouk — Microsoft Certified Trainer