cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kcantor
Community Champion
Community Champion

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




1 ACCEPTED SOLUTION
tonysellars
Advocate II
Advocate II

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

35 REPLIES 35
patlaff
Frequent Visitor

Not sure if this will help everyone, but I received this error because I had not yet given permissions to the SQL account for the new database I was trying to connect to. Make sure the account you're using has at least read permissions, otherwise this error will be thrown.

patlaff
Frequent Visitor

Not sure if this will help everyone, but I received this error because I had not yet given permissions to the SQL account for the new database I was trying to connect to. Make sure the account you're using has at least read permissions, otherwise this error will be thrown.

jhansjr
New Member

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. 

 

tonysellars
Advocate II
Advocate II

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

Thanks! This fixed the problem for me!

My fix was slightly different.  I needed to update the db tables and my credentials, but this solution got me 90% there.  

Anonymous
Not applicable

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

Remove Navigation step, as it attempts to read full table from DB and that does not match with your source querry

The query itself contains a lot of metadata related to the source you are pulling from and it seems that this can get a bit out of whack.  The case you are looking at here you have a many different steps you are going through.  The issues for this error have typically been in the source step.  To see all the steps and see how the query progresses you can take a look at the progression as each step generates a result which is operated agaist by the next step.  The original trick to refresh the query, has worked for me and I was glad to see that it seemed to work with Power Query as well as it uses basically the same mechanism.  If you do continue to get an error even after refresh, take a look at the advanced editor and see if something jumps out as not being in sync with your source in one of the later steps.

 

AdvancedEditor.png

 

Hope this helps.

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?

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

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.

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

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 ?

 

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:

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors