Forum Discussion
Create powerBI columns with SQL queries
- 2 years ago
If your source is SQL it automatically converts as much as it can to SQL and pushes the work up to the SQL server.
You can manually write out SQL when you establish the connection, this is *usually* meant to copy-paste in an existing extract vs writing new SQL but nothing is stopping you writing new code there.
If your source is excel files you're out of luck. There's no SQL engine for it to send your code to.
- Anonymous2 years ago
Hi andreazambon ,
In Power Query, only M code can be used.
However, you can use SQL statements to pre-filter when connecting to SQL Server.
Tutorial: Connect to on-premises data in SQL Server - Power BI | Microsoft Learn
Some ways about filtering in Power Query for your reference:
Filter data (Power Query) - Microsoft Support
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If your source is SQL it automatically converts as much as it can to SQL and pushes the work up to the SQL server.
You can manually write out SQL when you establish the connection, this is *usually* meant to copy-paste in an existing extract vs writing new SQL but nothing is stopping you writing new code there.
If your source is excel files you're out of luck. There's no SQL engine for it to send your code to.