Fix "the key didn't match any rows in the table" in Power BI
Power BI's key didn't match any rows in the table error decoded: the three documented causes — a renamed source table, missing privileges, or mixed credentials — and the schema-refresh fix that actually clears it.
Power BIFix a problem4 min read
A report that refreshed happily for months suddenly fails with Expression.Error: The key didn't match any rows in the table — one of the most-asked errors on Microsoft's forums, and one of the most mechanical to fix once you know what it means.
- Scheduled or manual refresh fails in the service; Desktop may still work, or fail on the same step.
- The full message carries a clue:
Key = [Schema = "dbo", Item = "YourTable"]. Table = #table({...}, {})— an empty table where the named one should be. - It often starts right after someone "tidied up" the database, renamed a sheet or list, or a new file replaced an old one.
Read the error first
Power Query's engine looks tables up by name. This error, per Microsoft's Power Query documentation, means exactly one thing: the engine couldn't find the table it was told to load — and the Key = [...] fragment tells you which name it searched for. Everything that follows is just the three documented reasons a lookup comes back empty.
Cause 1: the table changed at the source
The usual suspect: the table, view, sheet or list named in your query was renamed, moved or deleted at the source. Two-part fix, and the second part is the one people miss:
- In Power BI Desktop, open Power Query Editor, walk the Applied Steps of the failing query, and repoint the Source/Navigation step at the current name (or restore the old name at the source). While you're there, repair steps that depended on old structure — Changed Type, Renamed Columns, Removed Columns — the repair sequence Microsoft's own Q&A engineers recommend.
- Republish the semantic model. Microsoft's refresh documentation is explicit: a data refresh in the service fails when a source column or table is renamed, because the service doesn't perform a schema refresh. The schema refresh happens in Desktop; the service only learns about it when you publish.
- Find the new name at the source
- Repoint the Navigation step in Desktop
- Repair dependent steps
- Republish to the service
- Refresh
Don't
- Don't "fix" it by deleting error rows or removing the failing steps wholesale — Microsoft's guidance warns that hides the cause and ships incomplete data.
- Don't rename tables at the source without a plan: a later schema refresh also drops dependent relationships, measures and row-level security built on the old names.
Cause 2: the account can't read the table
Same error, different hole: the credential used for refresh lacks read permission on that specific table, even though it can reach the database. Classic after a security tightening, or when the gateway's stored credential is an account narrower than the author's. Test by connecting with the refresh credential itself; grant read on the table or switch the data source credential in the semantic model's settings.
Cause 3: two credentials, one source
Microsoft documents a third, sneakier cause: multiple credentials for the same cloud data source, which personal cloud connections in the service don't support. It surfaces when colleagues each connected to the same source with different accounts. Standardise on one credential for the source — or, for on-premises sources, route through the on-premises data gateway, which owns a single stored credential.
Still failing?
If the name is right, the privileges are right and the credentials are single, walk the failing query's remaining steps against the current source structure — a changed column type or an unexpected value can halt a step mid-refresh with knock-on lookup errors. Our refresh failures checklist covers the wider sweep from gateways to timeouts.
Sources
Did this fix it?
Comments
No comments yet. Share what worked for you.
Sign in to comment. Comments show under a display name you choose, never your email.