Power Query: Using SQL to reference within a spreadsheet, to update power query

mgrady11

New Member
Joined
Apr 18, 2017
Messages
11
Due to certain circumstances, this is how the data must be accessed.

I am trying to run a power query that, when it refreshes, it will query based on something that is within a specific reference.

I.e.

If I were to query a database that has four sales regions, but I only want to query one region at a time.
So the reference in the spreadsheet, that I would alter, would be either N, S, E or W.
Once one of the regions is selected, the power query would be refreshed and only pull data tied to that region.

Any ideas or resource links would be appreciated.

-Thank you
 

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.
Would do it like this.

Give the cell with the N, E, S, W a range name.
Create a query that pulls in this range name.
Right click at the top of the colum and choose drill down. Call this query say "Input"

Create a new query that does exactly what you would want it to for one input, say "N". Note the query step where you filter for "N".
Go into the advanced editor, look for the step with the filtering and replace the "N" with Input. Note that you won't need the quotes.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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