Forum Discussion
SQL Server Error on "Close & Apply"
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.