Prepared from documented information
Two exports can contain the same number of rows and still contain different customers. To find the differences, compare the IDs in both directions: keep the rows in the first list whose IDs are absent from the second, then reverse the comparison. Use a Left anti join in Power Query for each direction.
In this worked example, the two exception lists also show why two missing rows can mean one missing customer. A separate check explains why joining matching rows can give a surprisingly large total. The procedure follows Microsoft’s documentation. The invented data and expected counts have been checked with a script; the example has not been run in Excel.
The commands below use the English interface of Excel for Microsoft 365 on Windows. Keep a copy of each original export and use a separate workbook for the comparison.
Decide what the ID tells you
Use a field that identifies the thing you want to compare. A customer ID answers whether a customer appears in both exports. An order ID answers a different question. Comparing customer IDs will not reveal a missing order if that customer has another order in both files.
A repeated ID can be legitimate. One customer might have several orders, for example. Keep those rows while checking whether the ID exists in the other list. Deleting repeated IDs at the start would lose information you may need to investigate the exceptions.
This procedure compares exact keys. It does not reconcile amounts, compare every field on a matched record, or decide whether differently written names refer to the same customer.
If one of your inputs is a CRM report, first check what each report row represents. An association between records can add rows without adding another customer or deal.
Prepare the two lists
Put the two sample lists on separate source worksheets, InputA and InputB. Each has an ID column and a SourceRow column. SourceRow labels the original row so that an exception can be traced back; it is not part of the matching key.
Use these invented records as a small check before comparing your own files. An empty cell in the first table means a missing ID.
Export A
| SourceRow | ID |
|---|---|
| 1 | C101 |
| 2 | C101 |
| 3 | C102 |
| 4 | C102 |
| 5 | C104 |
| 6 |
Export B
| SourceRow | ID |
|---|---|
| 1 | C101 |
| 2 | C101 |
| 3 | C101 |
| 4 | C103 |
| 5 | C104 |
| 6 | C105 |
The exports have six rows each. Create a source query for each list:
- Select a cell in the first range and choose Data > From Table/Range. In Create Table, check the selected range includes both headers and all six rows, including A’s last row. Select My table has headers and confirm. Microsoft’s import instructions document this Windows path.
- In the Power Query Editor’s Queries pane, right-click the query name and choose Rename, then name it
ExportA. SelectIDand choose Home > Data Type > Text. Use Home > Close & Load > Close & Load to return its result to a worksheet. - Repeat for B, naming its query
ExportBand settingIDto Text as well. Keep these loaded-query worksheets separate fromInputAandInputB.
To reopen a query, use Data > Queries & Connections, then right-click its name and choose Edit. The source worksheets hold the sample data; the loaded-query worksheets show results produced from it. Microsoft explains these distinct environments in its create, load and edit guide.
Both matching columns must have the same type. Choose ID itself when matching, rather than the SourceRow labels. For real files, agree which ID field is shared by the two systems. Keep IDs with leading zeros as text. If spaces or letter case differ, resolve the rules used by the source systems before changing values. Otherwise, a cleaning step can merge identifiers that were meant to stay separate.
Separate blank IDs before comparing
In the editor’s Queries pane, right-click ExportA, choose Reference, and rename the new query ReadyA. Open the ID column’s filter and choose Remove empty, then OK. Repeat from ExportB to make ReadyB. Microsoft documents both query references and filters for null or blank values. A reference uses the earlier query’s output while allowing its own later steps.
There is one blank ID in A and none in B, so ReadyA has five rows and ReadyB has six. To keep the exception visible, create another reference from the unfiltered ExportA and name it BlankA. In its ID filter, clear (Select All), select only the blank/null entry and confirm. For this sample, that result is SourceRow 6. Check B for missing IDs too when applying the procedure to other files.
On larger files, the filter list initially shows up to 1,000 distinct values. If Power Query says the list is incomplete, use Load more before concluding that a value is absent from that list.
Use a filter on ID for this job. Remove Blank Rows checks the whole row; A’s last row contains SourceRow 6 and therefore is not an entirely empty row. Keeping its missing ID separate also prevents it being reported as a known customer missing from the other export.
Find the IDs present only in A
In the Power Query Editor, use Merge Queries as New to create a separate comparison query. Following Microsoft’s merge procedure:
- Select
ReadyAas the first table andReadyBas the second. - Select
IDin both previews. This example uses one matching column. - Explicitly choose Left anti as the join kind, then confirm the merge. Do not rely on the default join selection.
Left anti keeps rows from the first table that have no matching ID in the second. Name this result OnlyA so that its direction stays clear.
The merge also adds a structured column for the related table. Remove that added column with Home > Remove Columns > Remove Columns, retaining the original SourceRow and ID columns. Microsoft’s left anti example shows why the added column cannot supply the missing IDs: these rows have no match in the related table.
The expected result is:
| SourceRow | ID |
|---|---|
| 3 | C102 |
| 4 | C102 |
There are two exception rows and one distinct missing ID, C102. Keeping both rows lets you trace that customer’s two entries back to A. Count C102 once when reporting how many distinct customer IDs are absent from B.
Reverse the comparison to find the IDs present only in B
In the Queries pane, select ReadyB and create another merge as a new query, this time with ReadyB first and ReadyA second. Select ID in both and choose Left anti again. Name the result OnlyB and remove its added related-table column as before.
The expected result is:
| SourceRow | ID |
|---|---|
| 4 | C103 |
| 6 | C105 |
Here the two exception rows represent two distinct IDs. Running just OnlyA would have missed them. The same join kind works in both directions because changing the first table changes which rows it keeps. Microsoft’s JoinKind definitions describe these operations separately from joins that retain matching pairs.
Check distinct IDs separately from joined rows
Keep the units next to the totals. For this sample, the useful checks are:
| Check | A | B |
|---|---|---|
| Original rows | 6 | 6 |
| Rows with a missing ID, set aside | 1 | 0 |
| Distinct nonblank IDs | 3 | 4 |
| Exception rows absent from the other list | 2 | 2 |
| Distinct IDs absent from the other list | 1 | 2 |
For real exports, use the complete result tables for totals. The merge dialog’s matching-row preview is based on a top sample of rows.
The lists share two IDs: C101 and C104. If you make an inner join and expand its matching rows, C101 alone produces six pairs: its two rows in A each match its three rows in B. C104 contributes one more pair. The expanded result has seven rows, even though there are only two shared IDs.
That seven-row total counts pairs of matching rows. Microsoft’s Table.NestedJoin reference describes matching on equality of the selected keys; expanding the matches reveals the row combinations. Keep this seven-row illustration separate from the anti-join results. To find missing customer IDs, use the two exception lists and count their distinct IDs.
Keep the comparison useful on the next export
Load OnlyA, OnlyB and BlankA to worksheets so that the exceptions are available outside the editor. Use Home > Close & Load > Close & Load for the selected result query. For a query already in the workbook, Data > Queries & Connections, right-click the query and choose Load To to select its destination. Label these result worksheets clearly; keep the source tables on InputA and InputB.
For a small repeat check, change C103 to C102 in the source table on InputB, not in a loaded result. In Excel, select Data > Refresh All and wait for refresh to complete. The expected OnlyA result is now empty; OnlyB contains just C105. A has all three of its nonblank IDs represented in B. These are calculated expectations for the invented data, not a recorded Excel refresh test.
Refresh Preview inside the Power Query Editor updates its preview and cache; it does not by itself refresh the loaded worksheet or Data Model. Microsoft’s refresh guide distinguishes these operations. If a refresh fails, resolve the error before treating the existing result as current.
On later exports, check the source files and reporting periods, the meaning of ID, and the blank-key exceptions again. A match on customer ID does not establish that every other field agrees. Review OnlyA and OnlyB, trace their exceptions through SourceRow, and keep the blank-ID exceptions alongside them. You can then investigate three specific groups: IDs absent from B, IDs absent from A, and rows that need an ID before they can be compared.



