Intermediate level · Module 1: Power Query for Analysts · Lesson 2 of 3
Cleaning and Reshaping
Clean, unpivot, merge and append data into tidy tables.
In this lesson you will
- Clean and set types consistently
- Unpivot, merge and append queries
Key concepts
data typesunpivotmerge queriesappend queries
The lesson
Clean every source the same way: remove extra rows, promote headers, trim text, set types. Mismatched types — a code as text in one table and a number in another — break relationships later.
Unpivot wide budget sheets with months as columns into tidy month and amount columns.
Merge adds columns from a related table; append stacks tables with the same columns. Check row counts after each.
Step by step
- Clean the branch files query.
- Unpivot the budget sheet.
- Merge product categories into sales.
- Check row counts.
Practice activity
Prepare clean, tidy tables for sales, budget and products.
Expected result: Tidy tables with consistent types and verified row counts.
Check your understanding
-
Why must key columns have the same type in every table?
Show answer
Relationships fail or behave wrongly if types differ.
-
What does unpivoting a budget sheet produce?
Show answer
One row per month and item instead of one column per month.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.