Getting data and cleaning it in Power Query
RawOrdersExport DimProductAssignments
Turn the messy export into a clean table
- Load RawOrdersExport with Get Data → Enter Data.
- Remove the first row (report header) and the last row (TOTAL) using Remove Top Rows and Remove Bottom Rows, not by filtering on a value.
- Trim and Clean every text column. Rename headers to PascalCase with no spaces.
- Fix Order Dt: use Column From Examples or Locale-aware Change Type so all seven date formats become one Date column. Check every row.
- Strip $ and " USD" from Unit Price and convert to Decimal Number. Replace "N/A" with null, then convert Qty to Whole Number.
- Capitalize Each Word on customer name and Region, so "west " and "WEST" both become "West".
- Remove exact duplicate rows. Delete the fully empty LegacyFlag column.
Reproduce the same clean-up as a reusable query
- Right-click your cleaned query → Reference. Name it "Orders Clean".
- In the original query, disable Enable Load so only the referenced query lands in the model.
- Change one input value in the Enter Data source (e.g. change $199.99 to $209.99) and refresh: the clean query must update without a single manual step.
Join product attributes
- Load DimProduct.
- In Orders Clean, Merge Queries with DimProduct on product name. Notice that "TRAIL CHEF STOVE" does not match: fix casing before the merge, not after.
- Expand only Category and ProductKey.
- Use Left Outer, then check the row count. Then try Inner and see which rows disappeared and why.
Profile before you trust
- Turn on Column quality, Column distribution and Column profile in the View ribbon.
- Change profiling from "top 1000 rows" to "entire data set".
- Write down, for Qty: % valid, % error, % empty, distinct count, unique count.
Interview questions
- What is the difference between Remove Duplicates and Remove Rows → Remove Errors, and when would each silently corrupt your data?
- Why does Change Type to Date fail on "Jan 7 2026" and "06/02/2026" in the same column, and how do you fix it?
- Someone applied steps in the wrong order: Change Type before Replace Values. What breaks?
- What is query folding and how can a beginner check whether a step folds?
- When is a Reference better than a Duplicate?
Assessment
After Remove Top Rows(1) and Remove Bottom Rows(1) on RawOrdersExport, how many rows remain before de-duplication?
- 27
- 28
- 29
- 30
Which step turns "$699.99" into a usable number with the fewest chances of error?
- Change Type → Decimal Number directly
- Replace "$" with "" then Change Type
- Split column by delimiter "$"
- Extract text after delimiter
Column profile says Qty has distinct = 9 and unique = 3. What does unique = 3 mean?
- 3 rows have Qty
- 3 different values of Qty appear only once
- 3 nulls
- 3 errors
Load RawOrdersExport and produce a table with exactly these column types: OrderRef Text, OrderDate Date, CustomerName Text, Product Text, Qty Whole Number, UnitPrice Decimal, Region Text, Notes Text. Zero error cells. Screenshot the Applied Steps pane.
Order of steps: remove rows → replace values → trim/clean/capitalize → change type → remove duplicates.