Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
HamidBee
Power Participant
Power Participant

Where do I add a parameter into my table query?

I have imported a table using SQL query into Power BI. I then created a parameter in Power Query with the name as 'Country' and set the Current Value as 'England'. I understand that I am meant to edit the table query to include this parameter but I'm not sure where to add this. Currently my table query looks like this:

 

=Sql.Database("DESKTOP-Name\SQLEXPRESS","X",[Query="SELECT * FROM dbo.Examples$"])

 

The name od the table is : dbo.Examples$

Columns in the table are: Country, Sum and People

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HamidBee , One way I can think of is

 

=Sql.Database("DESKTOP-Name\SQLEXPRESS","X",[Query="SELECT * FROM dbo.Examples$ Where country = '" &Parameter1 & "' "])

 

also refer

https://www.fourmoo.com/2020/10/08/power-query-m-passing-parameters-dynamically-to-a-sql-server-quer...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@HamidBee , One way I can think of is

 

=Sql.Database("DESKTOP-Name\SQLEXPRESS","X",[Query="SELECT * FROM dbo.Examples$ Where country = '" &Parameter1 & "' "])

 

also refer

https://www.fourmoo.com/2020/10/08/power-query-m-passing-parameters-dynamically-to-a-sql-server-quer...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for the solution Amit. In case anyone else would like to look into this further I did find a useful resource:

https://www.red-gate.com/simple-talk/databases/sql-server/bi-sql-server/power-bi-introduction-workin...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.