Reply
New Contributor
Posts: 581
Registered: ‎08-27-2015
Accepted Solution

Expression.Error: The key did not match any rows in the table

I have a data set that has refreshed successfully in the past. It was built 3 days ago and refreshed fine for two days. Now I cannot refresh it either on the desktop version or from services. The error reads Expression.Error: The key didn't match any rows int he table. Other tables return the error message Load was cancelled by an error in loading a previous table. I tried to delete the problematic table from the data set with plans to re add it later. When I deleted the problem table, a second table threw the same error. I removed it too and a third then erred.  It is a domino effect. All tables are failing one at a time. The tables, however, are fine. I can use them in other documents and in PowerPivot. any ideas?

A coworker updated her version and the gateway and is getting the same error. This was built in a group and resides in the group folder.


Accepted Solutions
Highlighted
Frequent Visitor
Posts: 8
Registered: ‎08-25-2015

Re: Expression.Error: The key did not match any rows in the table

Ran into this issue myself within the Power BI Desktop and was able to resolve the issue through the following:

 

  1. Select Edit Queries from the menu to open the Query Editor
  2. Use the left hand menu to select one of the queries having the issue (will have the triangular warning sign)
  3. On the applied steps menu at the right select the source step.
  4. In the top menu bar, select Refresh Preview.

In my case there were several queries having this same issues and the steps above resolved each of them.

 

Hope this helps -

View solution in original post


All Replies
Highlighted
Frequent Visitor
Posts: 8
Registered: ‎08-25-2015

Re: Expression.Error: The key did not match any rows in the table

Ran into this issue myself within the Power BI Desktop and was able to resolve the issue through the following:

 

  1. Select Edit Queries from the menu to open the Query Editor
  2. Use the left hand menu to select one of the queries having the issue (will have the triangular warning sign)
  3. On the applied steps menu at the right select the source step.
  4. In the top menu bar, select Refresh Preview.

In my case there were several queries having this same issues and the steps above resolved each of them.

 

Hope this helps -

Frequent Visitor
Posts: 2
Registered: ‎12-31-2015

Re: Expression.Error: The key did not match any rows in the table

Hi Tony,

 

I have the same error but I am using power query in Excel. I am using a personal gateway, here is my error message below:

Occasional Visitor
Posts: 1
Registered: ‎11-12-2015

Re: Expression.Error: The key did not match any rows in the table

[ Edited ]

Nothing changed - 1 day it worked - the next day refresh bombed with this message

The refresh preview approach did not resolve the issue for me.

I created new connections to the same data source and then used Advanced Edit to copy the new connection strings to my original tables.

Has Microsoft acknowledged this is a PowerBI Desktop issue ?

Anybody understand the root cause ?

 

Frequent Visitor
Posts: 14
Registered: ‎09-10-2015

Re: Expression.Error: The key did not match any rows in the table

Thak you. It solved my problem but do you know why it happened in the first place?

New Member
Posts: 1
Registered: ‎03-25-2016

Re: Expression.Error: The key did not match any rows in the table

I have noticed this problem when saving a workbook at work, then using a synched version of the same workbook at home and vice-versa (different computers). In my case my workbook contained several queries from sharepoint sources. All of them indicated the same error upon opening the workbook at a different location, even though the sharepoint url pointing to my data sources should have worked just fine. 

 

I tried the Tony's solution offered here and that worked fine. But I felt having to open and refresh each of my queries one-by-one everyday was bound to become irritatingly cumbersome, especially since some of my workbooks pull 10 or more sources. 

 

I found an alternate solution that worked for me. 

 

1. Go to the DATA tab in Excel and click on the Connections icon. 

2. Find the connected query(ies) that are having the error

3. Click on the Properties button to the right. 

4. Under the first section called "Refresh control", check the box labled "Refresh data when opening the file"

 

You may have to experiment with how this affects your individual performance but for me it solved the error issue. 

 

Frequent Visitor
Posts: 2
Registered: ‎11-10-2016

Re: Expression.Error: The key did not match any rows in the table

This did not work for me either.  I connected to a database, then copied some views into that db.  PowerBi keeps giving me the message about keys not matching.  

 

I've gone into each view to change the source to the new db and then hit refresh but i still get the message of keys not matching.  Any suggestions?

Frequent Visitor
Posts: 2
Registered: ‎11-17-2016

Re: Expression.Error: The key did not match any rows in the table

I also had this problem and the reason is that every time I download the raw data from salesforce, the worksheet is given a different name, so the worksheet name needs to be updated in each query under 'navigation'. I have only had this issue since importing xls files rather than csv's, so might just go back to csv's.

Frequent Visitor
Posts: 2
Registered: ‎11-17-2016

Re: Expression.Error: The key did not match any rows in the table

This issue happened to me and it is because whenever I download the raw data from Salesforce it gives the worksheet within the xlsx file a different name. I have to go into each query and update the worksheet name under 'navigation'. This problem has only occured for me since importing xls files rather than csv, might just go back to using csv's

Regular Visitor
Posts: 26
Registered: ‎01-09-2017

Re: Expression.Error: The key did not match any rows in the table

Hello @tonysellars,

 

I had same issue and with your trick I manged to fix it.

 

However, in the next steps of the query i got the following message:

 

2017-02-03 15_25_53-Monthly Report TEST_V2 - Query Editor.png

 

Know how to fix this?

 

Thx in advance.

 

Cheers,

Andrea