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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors