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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.