cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Passing values to variables declared in Power BI SQL Statement

Hi @saujanyae ,

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.

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Passing values to variables declared in Power BI SQL Statement

Hi @saujanyae ,

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.

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.

View solution in original post

Highlighted
Helper II
Helper II

Re: Passing values to variables declared in Power BI SQL Statement

Thank you! will try it out.

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors