By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
You’re building a Power BI report for a retail client. They give you: - Sales data (transactions, dates, product IDs, quantities) - Product catalog (product IDs, names, categories, cost prices) - Store locations (store IDs, regions, managers)
Problem: You can’t just dump these tables into Power BI and expect magic. If you don’t merge (join) the sales data with the product catalog, you won’t know what was sold. If you don’t append (stack) last month’s sales with this month’s, you won’t see trends.
Why this matters in production:- Broken reports: If you merge incorrectly (e.g., Left Outer instead of Inner), you’ll silently drop rows, leading to wrong totals.- Performance nightmares: A bad join on large tables can turn a 2-second refresh into a 20-minute slog.- Data integrity risks: If you append mismatched columns, Power BI will either error or create nulls, corrupting your analysis.
Left Outer
Inner
Real-world scenario:You inherit a Power BI file where someone manually copied-pasted Excel sheets into one table. Now, the report is slow, breaks on refresh, and no one trusts the numbers. Your job: Fix it by properly merging and appending queries.
Full Outer
UNION ALL
SUM
ProductID
Table.Distinct()
Goal: Combine sales transactions with product details.
Sales
| OrderID | ProductID | Quantity | Date | |---------|-----------|----------|------------| | 1 | P100 | 2 | 2023-01-01 | | 2 | P200 | 1 | 2023-01-02 | | 3 | P300 | 3 | 2023-01-03 |
Products
| ProductID | ProductName | Category | CostPrice | |-----------|-------------|----------|-----------| | P100 | Laptop | Tech | 500 | | P200 | Mouse | Tech | 20 | | P400 | Chair | Furniture| 100 |
ProductName
Category
CostPrice
Expected Output:
| OrderID | ProductID | Quantity | Date | ProductName | Category | CostPrice | |---------|-----------|----------|------------|-------------|----------|-----------| | 1 | P100 | 2 | 2023-01-01 | Laptop | Tech | 500 | | 2 | P200 | 1 | 2023-01-02 | Mouse | Tech | 20 | | 3 | P300 | 3 | 2023-01-03 | null | null | null |
Why this works: Left Outer keeps all sales rows, even if ProductID P300 doesn’t exist in Products.
Goal: Combine January and February sales into one table.
Sales_Feb
| OrderID | ProductID | Quantity | Date | |---------|-----------|----------|------------| | 4 | P100 | 1 | 2023-02-01 | | 5 | P400 | 2 | 2023-02-02 |
Sales_Combined
| OrderID | ProductID | Quantity | Date | |---------|-----------|----------|------------| | 1 | P100 | 2 | 2023-01-01 | | 2 | P200 | 1 | 2023-01-02 | | 3 | P300 | 3 | 2023-01-03 | | 4 | P100 | 1 | 2023-02-01 | | 5 | P400 | 2 | 2023-02-02 |
Why this works: Both tables have the same columns, so Power BI stacks them.
powerquery = Table.Distinct(#"Previous Step", {"ProductID"})
0
powerquery = Table.ReplaceValue(#"Merged", null, 0, Replacer.ReplaceValue, {"CostPrice"})
powerquery = if [ProductName] = null then "Missing Product" else "OK"
powerquery // Left Outer join to keep all sales, even if product data is missing.
SKU
powerquery = Table.AddColumn(#"Previous Step", "RowCount", each Table.RowCount(#"Previous Step"))
Text.Upper()
Text.Lower()
Trap: Confusing Left Outer with Right Outer.
Right Outer
"You have two tables with different column names. What happens when you append them?"
Trap: Assuming it will error (it won’t, but it’s still wrong).
"How do you merge tables when the key has duplicates?"
Trap: Suggesting Group By (overkill for this case).
Group By
"Which join type is most performant for large tables?"
"You need to combine two tables where 10% of the keys don’t match. Which join type should you use?"- Answer: Left Outer (if you need all rows from the left table) or Full Outer (if you need all rows from both).- Why not Inner? It would drop the 10% unmatched rows, losing data.
You have two tables: - Employees (columns: EmployeeID, Name, Department) - Salaries (columns: EmpID, Salary, Bonus)
Employees
EmployeeID
Name
Department
Salaries
EmpID
Salary
Bonus
Task:1. Merge the tables to show all employees (even those without salaries).2. Replace null Salary values with 0.
powerquery = Table.ReplaceValue(#"Expanded Salaries", null, 0, Replacer.ReplaceValue, {"Salary", "Bonus"})
Why it works:- Left Outer keeps all employees.- Table.ReplaceValue handles nulls.
Table.ReplaceValue
= Table.NestedJoin(Table1, "Key1", Table2, "Key2", "NewColumn", JoinKind.LeftOuter)
= Table.NestedJoin(Table1, "Key1", Table2, "Key2", "NewColumn", JoinKind.Inner)
= Table.Combine({Table1, Table2})
= Table.Distinct(PreviousStep, {"KeyColumn"})
= Table.ExpandTableColumn(PreviousStep, "NewColumn", {"Column1", "Column2"})
= Table.ReplaceValue(PreviousStep, null, 0, Replacer.ReplaceValue, {"Column"})
= Table.FuzzyNestedJoin(Table1, "TextKey1", Table2, "TextKey2", "NewColumn")
= Table.SelectRows(PreviousStep, each [Date] >= #date(2023, 1, 1))
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.