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
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Kudoed Authors