Advanced Excel and Power Query — Free Starter Lesson
Free software starter lesson · 15 minutes · Beginner. Use Excel Power Query to clean a sales table and calculate revenue by region. You’ll need a version of Excel with Power Query.
1. Set up the practice data
Save the sample below as sales.csv and import it into Power Query from Excel’s Data tab. The spaces around some region names are intentional.
Order ID,Region,Revenue
1001,North,120
1002, North ,80
1003,South,50
1004, South ,70
1005,,30
2. Clean and summarize the data
Set Region to Text and Revenue to Whole Number. Trim the Region column to remove leading and trailing spaces, then filter out blank or null regions. Use Group By on Region and sum Revenue into a column called Total Revenue. Load the summary into an Excel worksheet.
Try it yourself
Add an order with ID 1006, region North, and revenue 40 to the CSV. Save it and refresh the query from Excel. Check that only the North total changes.
Self-check
Before the refresh, North should total 200 and South should total 120. After the refresh, North should total 240 and South should still total 120. The blank-region order contributes 30 to the raw data and is excluded from the summary. In a real report, flag that order for review before treating the regional totals as complete.
Watch the Power Query companion video for a one-minute walkthrough.
Explore the other free starter lessons on Learning Progress.