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

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

Reply
rjs2
Resolver I
Resolver I

Prompting and Passing Parameters in query

Hello all

 

I am trying to pass a parameter in the sql query, like in crystal reports.  That way I can limit the amount of data that is being loaded in and I can create a report for different teams.  All the data is the same, its just filtering it before loading for those team. 

 

My parameter is named Team_Input. 

 

I got this to work, but it pulls no data (no errors too)

 

""DOC"",""Team_Name""='Text.From(Team_Input)'

 

 

 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @rjs2 

Please check this article: https://community.powerbi.com/t5/Desktop/Parameterized-SQL-Query-with-query-folding/td-p/171503

 

You need & to combine text with an M-command. So something along these lines:

 

""DOC"",""Team_Name""=' " & Text.From(Team_Input) & " '

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

5 REPLIES 5
ImkeF
Community Champion
Community Champion

Hi @rjs2 

Please check this article: https://community.powerbi.com/t5/Desktop/Parameterized-SQL-Query-with-query-folding/td-p/171503

 

You need & to combine text with an M-command. So something along these lines:

 

""DOC"",""Team_Name""=' " & Text.From(Team_Input) & " '

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

How do you get it to ask for the parameter during a refresh? or prompt the user to enter a new parameter?

ImkeF
Community Champion
Community Champion

Hi @rjs2 

I'm not aware of any such feature.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

ok.... I will search more.  If not, this at least makes it easy for me to change and build reports for multiple teams.

Thank you!!!  That worked!

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 Kudoed Authors