Forum Discussion
Passing values to variables declared in Power BI SQL Statement
How do we pass values to variables declared in Power BI SQL Statement? I am using a direct query.
Is there a workaround for this?
Hi Anonymous ,
Try not to use variable in your SQL statement. It will not prompt out any window for input value for variables. In this scenario, you can use Query Parameter in the generated Power Query ( just go to "Advanced Editor" in Query Editor).
For more details, see: Deep Dive into Query Parameters and Power BI Templates
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-xuding-msftCommunity Support
Hi Anonymous ,
Try not to use variable in your SQL statement. It will not prompt out any window for input value for variables. In this scenario, you can use Query Parameter in the generated Power Query ( just go to "Advanced Editor" in Query Editor).
For more details, see: Deep Dive into Query Parameters and Power BI Templates
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank you! will try it out.