MetricSign
Start free
Medium severityquery

Power BI Refresh Error:
The key didn't match any rows in the table

What does this error mean?

A lookup or merge operation in Power Query tried to find a key value that does not exist in the lookup table. This happens when a join expects every key from the left table to exist in the right table.

Common causes

  • 1A Table.SelectRows or lookup formula uses a value that is absent from the target table
  • 2A merge with JoinKind.Inner returns zero rows and downstream steps fail on the empty result
  • 3Reference data (dimension table) was updated and some keys that existed before no longer exist
  • 4A parameter value passed to a function does not match any row in the lookup
  • 5A Table.Column() or Record.Field() call references a field that does not exist in all rows

How to fix it

  1. 1Add error handling in Power Query: use Table.AddColumn with try...otherwise to handle missing key lookups.
  2. 2Change the merge join type from Inner to Left Outer to return all rows from the main table even without a match.
  3. 3Add a validation step that checks for unmatched keys and logs them rather than crashing the entire refresh.
  4. 4Review the reference data table for deleted keys that existing fact rows still reference.
  5. 5Use List.Contains() before attempting the lookup to conditionally handle the missing key case.

Example log output

[2026-05-11 03:14:22] Dataset refresh failed — PowerBIServiceException: Expression.Error: The key didn't match any rows in the table.
[2026-05-11 03:14:22] Query: DimProduct | Step: Merged Queries | Elapsed: 00:00:08
[2026-05-11 03:14:22] Refresh aborted. Dataset: Sales Analytics. Next scheduled attempt: 2026-05-12 03:00:00 UTC

Frequently asked questions

Does this error only affect the dataset or also the report?

The error occurs during the refresh — if the refresh fails, the report shows the last successfully loaded data, not an error. Users won't see a broken report, but the data will be stale.

How do I find which Power Query step is causing the error?

Open Power BI Desktop and attempt a refresh. Power Query highlights the failing step in the Query Editor. The error message typically includes the table name and step name.

Can query errors be caused by data changes in the source?

Yes — if the source returns a data type the query doesn't expect (e.g., a null value in a previously non-nullable column), the query evaluation fails.

Does this error affect all tables in the dataset?

Usually only the table whose query evaluation failed. Other queries in the dataset may succeed unless they depend on the failed query's output.

Source · learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-sources

Other query errors