Forum Discussion
New to BI. Writing SQL queries to parse data. I am obviously missing something.
Hi anithat and supporting team , ElizabethTachji ,
I performed your procedure, only modifying the query to the table I need, as follows:
But I'm still getting this error:
Could you please help?
Best regards,
Fernando
If you are moving all of the required data into a single table in another database using a single query or stored proc, you can simply put that query or execution of that stored procedure into the query option area when you expand Advanced during the import. This is where a SQL query goes. After the import screens, when in the Source step and you go into the Advanced Editor in the Power Query Editor, this would be where you would write an M query to limit the data being brought in.
Finally, you could create a view in the same database as the tables and write a SQL statement to retrieve the data from the view.
Having the proper SQL indexes in the source database will help the performance drastically.
Please let me know if any of this helps.
I'm not sure if you saw my earlier response to your question, but you are trying to put an M query where the SQL query is supposed to go. You would put this query into the Advanced query of the data source after the import has happened when you are in the Power Query Editor, with the large table you want to limit the import highlighted on the left side, and the connection string step selected on the right side, click Advanced Editor as shown below ...
The other option would be to write the SQL statement as the following if using MS SQL Server as the source (other sources have different syntax)
SELECT * --or list out your column names that you want
FROM dbo.RIN1
WHERE DocDate > '20171231';
Please let me know if this helps. I know it has been a while since the original questions were posted.