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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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...

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...

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.