When to use this Power Query pattern
Use this pattern when the same data preparation step needs to happen every time a file, table or report refreshes.
Syntax or pattern
Table.NestedJoin(Sales, {"CustomerID"}, Customers, {"CustomerID"}, "Customer", JoinKind.LeftOuter)Typical UI steps
- Open Power Query Editor.
- Choose Merge Queries.
- Select the matching key columns in both tables.
- Choose the join kind and confirm.
- Expand only the columns needed.
5 practical examples
Use Merge queries in a sales report
This example shows how to use Merge queries when preparing a sales report.
Table.NestedJoin(Sales, {"CustomerID"}, Customers, {"CustomerID"}, "Customer", JoinKind.LeftOuter)Use this pattern when the sales report needs a repeatable transformation instead of manual cleanup.
Use Merge queries in a customer list
This example shows how to use Merge queries when preparing a customer list.
Table.NestedJoin(Amount, {"CustomerID"}, Customers, {"CustomerID"}, "Customer", JoinKind.LeftOuter)Use this pattern when the customer list needs a repeatable transformation instead of manual cleanup.
Use Merge queries in a inventory export
This example shows how to use Merge queries when preparing a inventory export.
Table.NestedJoin(Units, {"SKU"}, Customers, {"SKU"}, "Customer", JoinKind.LeftOuter)Use this pattern when the inventory export needs a repeatable transformation instead of manual cleanup.
Use Merge queries in a monthly dashboard
This example shows how to use Merge queries when preparing a monthly dashboard.
Table.NestedJoin(Revenue, {"CustomerID"}, Customers, {"CustomerID"}, "Customer", JoinKind.LeftOuter)Use this pattern when the monthly dashboard needs a repeatable transformation instead of manual cleanup.
Use Merge queries in a operations tracker
This example shows how to use Merge queries when preparing a operations tracker.
Table.NestedJoin(Hours, {"CustomerID"}, Customers, {"CustomerID"}, "Customer", JoinKind.LeftOuter)Use this pattern when the operations tracker needs a repeatable transformation instead of manual cleanup.
Common mistakes to avoid
- Joining on columns that contain hidden spaces or inconsistent data types.
- Creating duplicate rows because the lookup table has more than one match per key.
- Forgetting to choose the correct join kind before expanding columns.
FAQ
When should I use Merge queries in Power Query?
Use Merge queries when the transformation should be repeatable every time the data refreshes.
Can I do Merge queries from the Power Query interface?
Usually yes. The interface creates the M code for many common transformations, and you can adjust it in the formula bar or Advanced Editor.
Should I edit the M code manually?
Edit M manually when the interface cannot express the pattern clearly, or when you need reusable logic, parameters or cleaner step names.