Converting Query to Parameters

Misca

Well-known Member
Joined
Aug 12, 2009
Messages
1,760
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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

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