Power Query Data Source Paramaterization

tschuman

New Member
Joined
Jun 29, 2015
Messages
2
Power Query Data Source Paramaterization
Our team needs to create a workbook with 60 queries.
The Data Source for the queries will be a web data source.
The same 60 queries would be applicable across three web environments (Dev, QA, & Prod)
Example
· http://dev.mycompany.com
· http://qa.mycompany.com
· http://prod.mycompany.com
The Data source URLs contain will month and year variables
Example
· http://dev.mycompany.com?Month=JAN&Year=2015
· http://qa.mycompany.com?Month=JAN&Year=2015
· http://prod.mycompany.com?Month=JAN&Year=2015
How can we parametrize Power Query such that I can vary the environment, month and year and only maintain single 60 query workbook for all of our environments?
We are relatively new to Power Query and have not had much luck attempting this on our own.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
In order to pass a parameter to PQ you could create a table ("Tabelle1") with one line for each of your source environment strings (call that column "Name").
Then add a column ("Choose") where you fill an "x" to the one to choose.
Then the following query would deliver the selected string/Parameter:

let
Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
FilterChoose = Table.SelectRows(Source, each [Choose] = "x"),
ResultAsText = FilterChoose{0}[Name]
in
ResultAsText

But I wonder why you go for 60 queries.
This sounds as if what you really need is a web-scraping-approach like this:

https://social.technet.microsoft.co...sheets-published-on-yahoo-finance?forum=Excel

If that's the case, you'd just have to create a dynamically changing source-table in Excel (Text-&Field-relation-concatenation).
 
Upvote 0

Forum statistics

Threads
1,224,106
Messages
6,176,380
Members
452,726
Latest member
HaploTheGreat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top