Forum Discussion
Direct Query - Queries using CTE's are not being accepted
- Anonymous2 years ago
Hi Anonymous
I'm afraid the answer is No. As of now, CTEs still don’t work in DirectQuery mode. I find the following description from official document Data transformation limitations of DirectQuery.
Also, the Get Data dialog or Power Query Editor use subselects within the queries they generate and send to retrieve data for a visual. Queries defined in Power Query Editor must be valid within this context. In particular, it's not possible to use a query with common table expressions, nor one that invokes stored procedures.
As a workaround, consider building your data sets in SQL Server using views and then connecting directly to those views in Power BI.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos! - Anonymous2 years ago
Thanks very much for the feedback and the specifics. I guess an answer, even if it isn't the one I was hoping for, is better than not knowing.
I'll make changes to the queries with the CTE's.
I am receiving an error, and in my case even import doesn't work. It says syntax error around ";". The query runs well when in dbeaver