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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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...

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors