A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Craig,
Sample avail. here. You'll see I stored the drop-down values in a Table and created a Connection only to that Table. So the why is the following: if the search the Net on how to pass a value from an Excel workbook to a query, you'll find different ways to do this, and all are valid ones. They usually suggest doing this in 2 steps:
- Define a name range at the workbook level - that you be one your drop-down to "capture" its value
- In the query do something like (that's one way, as I said before there are others):
myParam = Table.FirstValue(Excel.CurrentWorkbook(){[Name="myDefinedName"]}[Content])
No problem this works
Now, if you have more that one value to pass to a query, storing those values in a Table has at least 3 benefits:
- Faster than creating n Defined names + it's a structured approach + if you hide the sheet containing that Table you reduce the risks that someone deletes your Defined names
- Easier to update your query if you later need to get additional values from your workbook for your queries
- Most important one is efficiency as you read your Table (and if you read it more than one time you can even Buffer it as it's small one), instead of making n calls like Table.FirstValue... mentioned above
Hope this all makes sense
No idea what your level of expertise is re. Power Query. So suggestion is you look at the code of query QueryResult and let me know if you have questions. You will see that I made 1 parameter optional (ClientType)