Forum Discussion
SQL Server Error on "Close & Apply"
I have a Power BI Query which connects to a local SQL Server Database. It works fine in Power Query Editor, however when I press "Close & Apply" it returns an error. Any suggestions?
Note: There is only 1 step (the SQL Query), and the Query is valid (tested in SSMS and Power Query Editor via Refresh Preview)
2 Replies
- AnonymousNot applicable
Generally when you are working in the Query Editor, you are only working from a sample set of data (first 1000 rows). From time to time there is some data that breaks your import logic but that data isn't found within the sample set. When you hit close and apply, all of the data is bring brought in and only then does the problem come to light.
To help with your troubleshooting, you can apply additional temporary filters, which will cause Power Query to get a more narrow sample set. This can be useful for locating what the problem is if you can figure out approximately where in your data the issue exists. I had one recently where some user entered data was creating a problem. I knew approximately when this was entered, so i was able to constrain the data to a certain time period until the exact error appeared in the Query Editor. This let me isolate the problem, then create a fix that I knew would account for this issue long term.
The error message should give you a guide where to start. Since you haven't included the error its going to be hard guess what the issue is.
- AnonymousNot applicable
jvmorren,
Could you please post the full error message you get? If you want to import limited SQL data using SQL query, you can input the SQL statement in the highlighted box during the import process.
Regards,
Lydia