Power Query and a Sales Report Project
Power Query (Data → Get & Transform) cleans and combines data with recorded steps. Set it up once; next month, press Refresh and every step runs again on the new data.
Many office jobs repeat the same cleaning every week or month: download a report, delete columns, fix dates, combine files, then build a summary. Power Query records those steps once and replays them with one click, so next month's report takes seconds. It's the same tool used inside Power BI, so learning it opens the door to data analysis roles.
The workflow
- Data → Get Data → From File (CSV, Excel, a whole folder) or From Table/Range.
- In the Power Query Editor, clean with buttons: remove columns, Split Column, change types, Replace Values, filter rows, Remove Duplicates.
- Each action is saved in Applied Steps on the right. Click a step to see the data at that point.
- Merge Queries works like a lookup between two tables; Append stacks tables with the same columns.
- Close & Load puts the result in a new Table.
From Folder is magic for monthly files: drop next month's CSV into the folder, press Refresh, and all months are combined again.
Project: monthly sales report
Put the lessons together into a one-page report:
- 1. Data: load the sales CSV with Power Query, fix types, trim text, remove duplicates, and add a
Monthcolumn (Add Column → Date → Month → Start of Month). Load it as the TableSales. - 2. Inputs: a cell with a drop-down for the month (Data Validation list).
- 3. Key numbers: total sales
=SUMIFS(Sales[Amount], Sales[Month], B1), number of orders withCOUNTIFS, average order value. - 4. Top products:
=TAKE(SORTBY(UNIQUE(Sales[Product]), SUMIFS(Sales[Amount], Sales[Product], UNIQUE(Sales[Product])), -1), 5). - 5. Pivot table + chart: sales by region and week, with a Region slicer.
- 6. Formatting: conditional formatting data bars on totals; red when a region is below target.
- 7. Protect: unlock only the month cell, then protect the sheet.
Example
Report sheet layout
┌──────────────────────────────────────────────┐
│ Month: [Nov-26 ▼] │
│ Total sales ₹4,82,300 Orders 1,204 │
│ Avg order ₹400 │
├───────────────────────┬──────────────────────┤
│ Top 5 products │ Sales by region │
│ (dynamic array) │ (pivot chart+slicer) │
└───────────────────────┴──────────────────────┘Ready for more? The next tools are Power Pivot (data models with millions of rows) and Power BI, which uses the same Power Query you just learned.
Key points
- Power Query records cleaning steps and replays them on Refresh.
- From Folder combines many files automatically.
- Load clean data into a Table, then build pivots and charts on it.
📝 Test yourself
1. What happens when you press Refresh on a Power Query table?
2. Which Power Query action works like a lookup between two tables?
3. Fill in the button that loads cleaned data back to Excel:
Close &
