cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emoroz
Regular Visitor

Power Query - Dynamic Parameters to run query

I have developed various templates that are stored in power query connection. I would like the user to select which connection query will be loaded into a table.

 

At this point, I have created a custom function that can load the query based on the selected name. (Code A)The code below only picks up the query to load if it is already loaded into a table in another part of the spreadsheet. I want to be able to load the query if is only in connection. Code B loads the query based on the specific name (connected query). I want input into code by the TemplateType selection criteria to select which query to load. I want code B to do what Coda A is doing. This is probably super easy but I just need the syntex. 

 

TemplateType: this a name range with a drop down of the specific query. 

 

 

Code A: Source = Excel.CurrentWorkbook(){[Name=TemplateType]}[Content]

 

Code B: Source = #"SinglePrice"

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi emoroz,

 

You can use query parameter to switch between data source in power query. You said "I want input into code by the TemplateType selection criteria to select which query to load. I want code B to do what Coda A is doing." , could you provide more details and give some sample to explain more explicitly?

 

Regards,

jimmy Tao

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors