Converting Query to Parameters

Misca

Well-known Member
Joined
Aug 12, 2009
Messages
1,749
Office Version
  1. 365
Platform
  1. Windows
I'm trying to learn how to use parameters in my Power Query queries.

The "main" query gets order data from an Excel table and I'm trying to build a Calendar table based on Order Dates in that query.

Normally I'd create the calendar table in the Power Pivot (yeah, I'm doing this in Power Pivot because Excel workbooks are much easier to spread around than the Power BI reports) but I want to include the public holidays in my Calendar so I'm using another query to get the holidays from a web service. For that I need the first and the last year from my Orders query so I've built a couple of queries that return the first / last year as a list:

Code:
let    Source = Orders,
    #"Calculated Earliest" = Date.Year(List.Min(Source[OrderDate]))
in
    #"Calculated Earliest"

Now I'd like to convert those queries as parameters but I can't select the Convert To Parameter -selection from the Query Settings. It doesn't seem to be grayed out but it just ignores my mouse cursor on that row. I could use the Create Function -option right before it but it just won't let me select the Convert To Parameter.

What am I doing wrong / How can I make it allow me to use the query as a parameter?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I had what I think was the exact same issue because I was trying to use a query on a table as the source for my parameter list so it would be fully dynamic. I couldn't find a solution anywhere on the internet (which is how I ended up here).

I have solved my issue with a combination of luck and a series of continual fumbling around. If you think about what we were trying to do, we were passing a whole table as a query into the values. Which column *should* the program use? To solve this, you need to open they query editor and the table you want then right click the particular column you want to use and select "convert to list". Once you do that, you should be able to select the converted list from the "Query" option box inside of the parameter creation dialog.
 
Upvote 0

Forum statistics

Threads
1,216,159
Messages
6,129,210
Members
449,493
Latest member
JablesFTW

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