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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
markwclancy
Frequent Visitor

Dynamic PowerQuery using ADF

Using ADF Pipelines, is there a way to pass parameters (or the entire M query) into the PowerQuery itself?

 

Here's a description of my challenge:
• I'm dealing with a dynamic data model from a form builder type application so the tables and column names are stored as data
• I'm generating PowerQuery code dynamically using Python as an initial activity in an ADF pipeline. There will be dozens of these PowerQuery scripts.
• I want to pass the PowerQuery code directly into the PowerQuery activity

• I don't see any way to make the PowerQuery dynamic --- it only seems to allow me to manually enter the PowerQuery

 

Any ideas/assistance would be appreciated.

1 ACCEPTED SOLUTION
markwclancy
Frequent Visitor

I was able to get this working as follows:

• A new activity was created that wrote the "parameters" for the PowerQuery into an Azure SQL table (with just "key" and "value" columns)

• A new query was created in PowerQuery that loaded the parameters from the table

•The parameters were assigned to variables in the PowerQuery -- e.g. groupFields = PowerQuery{[Key = "groupFields"]}[Value]

With this approach, the same PowerQuery code to generate multiple tables, (some with 100+ columns) with no hard-coding of the columns names.

View solution in original post

1 REPLY 1
markwclancy
Frequent Visitor

I was able to get this working as follows:

• A new activity was created that wrote the "parameters" for the PowerQuery into an Azure SQL table (with just "key" and "value" columns)

• A new query was created in PowerQuery that loaded the parameters from the table

•The parameters were assigned to variables in the PowerQuery -- e.g. groupFields = PowerQuery{[Key = "groupFields"]}[Value]

With this approach, the same PowerQuery code to generate multiple tables, (some with 100+ columns) with no hard-coding of the columns names.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors