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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Solution Authors
Top Kudoed Authors