Creating parameters

To create a new parameter in Power Query Editor, on the Home ribbon select Manage Parameters > New Parameter. You will then see the Manage Parameters window shown in Figure 1-11.

FIGURE 1-11 The Manage Parameters window

For each parameter, you can configure the following options:

  • Name This will become the parameter name by which you can reference it.
  • Description This will show up when you hover over the parameter in the Queries pane or when you open a report template that contains the parameter.
  • Required This determines whether the parameter value can be empty.
  • Type This is the data type of the parameter. Not all Power Query data types are available. For example, whole number cannot be selected; instead, you can choose decimal number for numerical parameters.
    • Suggested Values You can choose one of these three options:
    • Any value This is the default setting, and it allows any value within the limits of the parameter type.
    • List of values This allows you to type a list of values from which you can choose a parameter. When you use this option, you may also specify the default value, which will be selected if you open a template with this parameter.
    • Query When this option is selected, you will need to use a query of type list that will feed the list of values.
  • Current Value This is the value the parameter returns when you reference it.

Important Parameter Type

If you intend to change a parameter in the Power BI service, you must set its data type correctly. Using the Any type will prevent you from editing the parameter value in the Power BI service.