pbPassingBI
/
Data import & transformation intermediate 6 min

Merging and appending queries

Joining and stacking in Power Query, and when to do it in the model instead.

What you'll be able to do
  • Merge queries with the right join kind
  • Append queries
  • Decide between merging and modelling

Merge

Home → Merge Queries joins two queries on one or more columns. The join kinds are the SQL ones plus two extras:

KindKeeps
Left outerAll from first, matches from second
Right outerAll from second, matches from first
Full outerEverything from both
InnerMatches only
Left antiOnly first-table rows with no match
Right antiOnly second-table rows with no match

The anti joins are the useful additions — they answer which of these have no match directly, which is a query rather than a menu option in SQL.

Check the match rate

After merging, the new column shows Table for matched rows and null for unmatched. Filtering to nulls tells you immediately how many failed to match.

Merges fail on invisible differences

Trailing whitespace and case differences are the usual cause of a merge matching nothing on values that look identical. Apply Format → Trim and Lowercase to both key columns before merging.

Expanding

The merged column holds nested tables. Click the expand icon and choose which columns to bring through — take only what you need, since every extra column is loaded and stored.

Untick use original column name as prefix unless you want Products.ProductName.

Append

Append Queries stacks rows — twelve monthly files into one table. Columns are matched by name; anything present in one query and not another comes through as null.

For a folder of files, Get Data → Folder is better than appending manually: it reads every file matching the criteria, including ones added later.

Merge or model

You do not have to merge. Where two tables have a genuine relationship, loading both and creating a model relationship is usually better — it keeps the star schema, allows filtering in both directions, and avoids widening a fact table.

Merge when you need a lookup value denormalised onto a row for a calculated column, or when the result is genuinely one table.

Key points
  • Anti joins directly answer which rows have no match
  • Trim and lowercase both key columns before merging
  • Prefer a model relationship over a merge where a real relationship exists
Check yourself