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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Wei_Pan
Frequent Visitor

how to use multiple parameters in power query to replace fixed value from SQL query

Hi I have used SQL query to bring two cycles (8+4 2024 cycle and 6+6 2024 cycle) of forecast data into power query. Due to the large size of data, I created two parameters in power query called "current_forecast_cycle" and "quarter_commit_cycle" which is supposed to be equivalent to the fixed value "8+4 2024 cycle" and "6+6 2024 cycle", so that I can change the parameter values in the power BI server side each time when new cycle forecast is available.

 

Wei_Pan_1-1727666938098.png

Since I have zero M code experience, I just copied some prior answers from this community, like below. But it won't return a correct answer.

 

Wei_Pan_2-1727667022590.png

Can anyone help to suggest how to properly use M code to replace the two fixed cycle value with the two paramters in power query advance editor?

 

Much appreicated in advance.

1 ACCEPTED SOLUTION

Thank you @lbendlin . I finally managed to guess out how this "& and &" works in such situation, and that works perfectly.

Wei_Pan_0-1727702472255.png

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

move the closing parenthesis before the last double quote

Thank you @lbendlin . I finally managed to guess out how this "& and &" works in such situation, and that works perfectly.

Wei_Pan_0-1727702472255.png

 

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.