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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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