How to Compare Two Tables in Power Query (Anti Join Explained)

Power Query's Merge Queries dialog can answer every version of "what's different between these two tables" without writing a single formula, once you know which Join Kind to pick. The anti join options are the ones most people are actually looking for and the least self-explanatory by name.

Quick answer

Home > Merge Queries, select both tables, click the matching key column in each, then set Join Kind to Left Anti to get rows only in the first table, or Right Anti for rows only in the second. Use Inner to get rows that exist in both. Power Query is case-sensitive by default, so normalize casing with Text.Lower() on the key columns first if that matters.

Left Anti: what's only in Table A

Go to Home > Merge Queries (or Merge Queries as New to keep both originals untouched). Select Table A as the first table and Table B as the second. Click the key column in Table A, then click the matching key column in Table B - both should highlight. Set Join Kind to Left Anti, then click OK. The result is every row from Table A whose key does not exist anywhere in Table B.

Right Anti: what's only in Table B

Same dialog, same key columns selected, but set Join Kind to Right Anti. This flips the direction: you get rows from Table B whose key has no match in Table A. If you need both directions, run the merge twice with different join kinds rather than trying to get both from a single query.

Inner: what's in both

Set Join Kind to Inner instead. This keeps only rows whose key exists in both tables - the intersection. Combined with expanding the merged column, you can also see the matched values side by side to spot rows where the key matches but another column's value differs.

List.Difference in M code

let
    a = {"apple", "banana", "cherry"},
    b = {"banana", "date"},
    aOnly = List.Difference(a, b)
in
    aOnly
// {"apple", "cherry"}

If you're already in the Advanced Editor working with a plain List value rather than a full table, List.Difference(list1, list2) is the direct M-code equivalent of a Left Anti merge - no dialog needed. It's the function running behind the scenes for the simplest possible version of this problem.

Case sensitivity and other match pitfalls

Power Query compares key columns as case-sensitive text by default, which trips up people coming from Excel formulas like VLOOKUP or COUNTIF that ignore case. Normalize both sides with Text.Lower() in a custom column before merging if that matters. The other common cause of unexpected zero matches is a data type mismatch - one key column typed as Text and the other as Whole Number never match even when they display identically, so check the type icon in each column header before merging.

No Power Query needed for a simple list comparison. Paste both lists.

Open Compare 2 Lists →

Comparing plain spreadsheet columns instead of Power Query tables?

See the guide to comparing two Excel columns without formulas.

Read the guide →

Frequently Asked Questions

What is an anti join in Power Query?
An anti join returns rows from one table that have no matching key in the other. "Left Anti" keeps only unmatched rows from the first (left) table you selected in Merge Queries - the rows only in Table A. "Right Anti" does the same for the second (right) table - the rows only in Table B.
How do I compare two tables in Power Query step by step?
Load both tables as queries. Select the first table, go to Home > Merge Queries, choose the second table, click the matching key column in both, set Join Kind to Left Anti (rows only in the first table), and click OK. A new column of matched rows appears - remove it since it's empty for a Left Anti join, and you're left with the rows unique to Table A.
How do I see what is in both tables using Power Query?
Use the same Merge Queries dialog but set Join Kind to Inner instead of Left Anti. This keeps only rows whose key exists in both tables, which is the intersection.
Is Power Query case-sensitive when comparing keys?
Yes - unlike Excel formulas such as VLOOKUP and COUNTIF, which are case-insensitive by default, Power Query's Merge Queries and most M functions compare text as case-sensitive. "Apple" and "apple" are treated as different keys unless you explicitly normalize with Text.Lower() on both sides first.
Why does my Power Query merge show fewer matches than expected?
The most common causes are trailing or leading spaces in the key column (use Text.Trim()), inconsistent casing (use Text.Lower() on both sides), or a data type mismatch - one column is Text and the other is a Whole Number, which never match even if the displayed values look identical. Check each column's data type icon in the column header.
What is List.Difference in Power Query M code?
List.Difference(list1, list2) is the M-code equivalent of a Left Anti merge, but works directly on plain lists rather than tables: List.Difference({"apple","banana","cherry"}, {"banana"}) returns {"apple", "cherry"}. It's useful in the Advanced Editor when you're already working with a List value rather than a full table.
Do I need Power Query at all for a simple list comparison?
Not if your lists are just plain text with no other columns attached. Setting up two queries, loading them, and merging is worth it for recurring, connected data refreshes - but for a one-off comparison of two pasted lists, pasting them directly into a browser-based list comparison tool is faster than opening Excel at all.

Share this tool

Featured on ToolDirs
© 2026 ListDiff

Free online list and text processing tools.