Forum Discussion
Direct query syntax returns data in PowerQuery perfectly but shows error when update PowerBI project
- 2 years ago
I wrote a blog post about this:
Basically, if you can't use your SQL query as a subquery then you can't use it as a source in DirectQuery mode. The only workaround I'm aware of is this: https://prologika.com/power-bi-directquery-with-parameterized-stored-procedure/
You can use a table valued function as a source in DirectQuery mode though: https://blog.crossjoin.co.uk/2022/02/20/tsql-table-valued-functions-and-dynamic-m-parameters-in-power-bi-directquery/
I wrote a blog post about this:
Basically, if you can't use your SQL query as a subquery then you can't use it as a source in DirectQuery mode. The only workaround I'm aware of is this: https://prologika.com/power-bi-directquery-with-parameterized-stored-procedure/
You can use a table valued function as a source in DirectQuery mode though: https://blog.crossjoin.co.uk/2022/02/20/tsql-table-valued-functions-and-dynamic-m-parameters-in-power-bi-directquery/
- Martin_D2 years agoSolution Sage
Confirmed. The workaround works.
- Anonymous2 years agoNot applicable
Excellent solution! I have tried many approaches and almost given up. Today I finally managed to finish my PowerBI views. It really made my day! 🙂
- foodd2 years agoCommunity Champion
Nothing like getting the solution from the one and only source 🙂 Sign up for his Blog update if you have not already.
- foodd2 years agoCommunity Champion
Thank you Chris for taking the time to help with this.