Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Khalidc
Frequent Visitor

The key didn't match any rows in the table - SQL DB

Hi

 

I uploaded a .csv file in a SQL database using Sequal Server Management Studio. The file was uploaded correctly using the tasks - import flat file. However when I want to load it into Power BI using "New Source", I get the error: "Expression.Error: The key didn't match any rows in the table."

Khalidc_0-1684150321212.png

I can load it into Power BI desktop, but when I open the query editor I cannot edit the table because of the error:

Khalidc_1-1684150397698.png

 

The SQL database shows below view, as you can see the table names are the same:

Khalidc_2-1684150451499.png

 

I have googled several items concerning this error, but could find an answer to the above issue. Greatfull for any help.

 

 

 

 

 

1 ACCEPTED SOLUTION

Many thanks for your reply. But I have found the issue. It appeared to be in the permissions in data source settings. After clearing the permissions and providing them again in "edit permissions..." the refresh worked without error.

View solution in original post

2 REPLIES 2
ND_Pard
Helper II
Helper II

Sometime back I had a similar issue.

I resolved it by first creating the table structure in the SQL server.  Then instead of importing the .csv file into the server, I instead appended it to the table I had created in the server.  Then, if the same structure is needed for another  .csv file with the same structure, I simply copied the structure I had created in the SQL table to another new table and appended the new .csv file to that new table ... but a better solution might be to simply add a field that differentiates the newly appended data from the data currently in the table.  For example the field could be named:  Date_Appended or Appended_File_Name, etc.

I hope it helps.

Good Luck 🙂

Many thanks for your reply. But I have found the issue. It appeared to be in the permissions in data source settings. After clearing the permissions and providing them again in "edit permissions..." the refresh worked without error.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.