CertSafari
    Databricks Certified Data Analyst Associate· Lessons

    Domain 6 · Lesson 26/39

    Dashboard parameters, multi-select, date ranges and filter widgets

    Work with parameters in SQL queries and dashboards, including defining, configuring, and testing parameters.

    12 min read
    2.29% of exam
    3 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Add and configure a parameter in an AI/BI dashboard dataset and test it with a default value
    • Write the WHERE clauses for multi-select and date-range dashboard parameters, including the All case
    • Connect a parameter to a filter widget and populate its choices from a second dataset

    1.Declaring a parameter in a dashboard dataset

    An AI/BI dashboard parameter substitutes a value into a dataset's SQL at runtime, so data is filtered before it is aggregated rather than afterwards. Each parameter lives in the query of a single dataset. A dataset is the named query that dashboard widgets read from (Dashboard datasets), so every widget built on that dataset gets the parameter's effect. The parameter can then be wired to a filter widget, where viewers pick values, or set to a fixed value inside a visualization widget, which lets one dataset serve several charts.

    Adding a parameter needs at least CAN EDIT permission on the draft dashboard. In the Data tab, put the cursor where the value belongs and click Add parameter. This inserts a marker named parameter, which you rename by editing the text in the query. You can also type the marker yourself, using the same :name syntax as the SQL editor. Opening the parameter's settings shows the Parameter details dialog:

    • Keyword: the name used in the query. It can only be changed by editing the query text.
    • Display name: the label shown in the filter editor. It defaults to the keyword.
    • Type: String (the default), Date, Date and Time, or Numeric. Numeric can be Decimal (the default) or Integer.
    • Allow multiple selections: lets viewers pick several values. The query usually has to change to support this.

    Parameters change the query itself, and that makes them powerful. Field filters are the alternative, and they are often faster: on small datasets they run in the browser without re-running the query. A parameter always re-runs the query. Its advantage is placement. A parameter can sit anywhere in the SQL, such as before a join, inside a subquery or in conditional logic, while a field filter only applies to the dataset's final result.

    Checkpoint 1 of 6· Check yourself

    A dashboard dataset joins a large orders table to customers. Viewers must pick a region, and to keep the join cheap the region filter has to apply inside the orders subquery, before the join. How should the author set this up?

    Sources12

    2.Testing with default values

    To test a parameter, type a default value into the field under its name in the Data tab and run the query. Running the query does two things: you see a preview of the filtered rows, and the default value is saved. That default is not just for testing. Any filter widget bound to the parameter uses the Data-tab default unless the widget sets its own default.

    The default has a second job. Databricks runs the dataset with the default values to learn its schema, and uses that schema to fill in the widget configuration editor. A query that fails with its defaults can therefore break widget setup, even though it would succeed with any value a viewer selects at runtime. Queries that use the IDENTIFIER clause are the usual example. Before handing the dashboard over, confirm that every parameterized dataset runs successfully with its default values.

    Checkpoint 2 of 6· Check yourself

    An author's dashboard dataset reads FROM IDENTIFIER(:table). In the Data tab, the default for :table is a name that does not resolve, but every table a viewer could pick runs correctly. What problem should the author expect?

    Sources1

    3.Multi-select parameters with array_contains

    With Allow multiple selections turned on, the parameter is passed to the query as an array. An equality test or IN (:region) no longer fits; the query must use ARRAY_CONTAINS. The argument order matters. The parameter is the array and comes first, and the column value you are looking for comes second. The setting and the function depend on each other: if you use ARRAY_CONTAINS without enabling multiple selections, the query fails with an error.

    Multi-select filter: matches any selected quantity, or returns everything when the viewer chooses Allsql
    SELECT
      *
    FROM
      samples.tpch.lineitem
    WHERE array_contains(:parameter, l_quantity) OR :parameter IS NULL

    The OR :parameter IS NULL part handles the All option. When a viewer selects All, the parameter becomes NULL. That makes array_contains match nothing, and the IS NULL check returns every row instead. Without that check, choosing All would return an empty result. With specific values selected, a row is kept if its l_quantity matches at least one of them. To test a multi-select parameter, enter more than one default value in the field under the display name, selecting each value before typing the next, and run the query.

    Checkpoint 3 of 6· Fill the gap

    Complete this dashboard dataset query. The :parameter has Allow multiple selections turned on, and viewers can also choose All. Which function belongs in the blank?

    SELECT
      *
    FROM
      samples.tpch.lineitem
    WHERE  ? (:parameter, l_quantity) OR :parameter IS NULL

    Checkpoint 4 of 6· Exam question

    A retail analyst enables "Allow multiple selections" on a region parameter so dashboard viewers can pick several regions at once, including an option to show every region when nothing is explicitly chosen. Which WHERE clause correctly implements this multi-select behavior?

    Sources1

    4.Date-range parameters and relative defaults

    Choosing Date Range or Date and Time Range as the type creates two parameters in one, with .min and .max suffixes. When you name it in the dialog, give only the base keyword, such as date_param or ship_date, without the suffixes. In the query, refer to the two ends as :date_param.min and :date_param.max. As with multi-select, add an IS NULL check so that All returns every row.

    Date-range parameter with the All case handledsql
    SELECT * FROM samples.tpch.lineitem
    WHERE l_shipdate BETWEEN :date_param.min AND :date_param.max
      OR :date_param IS NULL

    To test a range, enter default dates and run the query. The calendar icon offers presets such as last week or last month. For a default that moves with the calendar, type an expression instead: now-{n}d/d means n days before today, and /d rounds the result to the start of the day. With .min set to now-30d/d and .max set to now/d, the dashboard always opens on the last 30 days.

    Checkpoint 5 of 6· Check yourself

    An author is moving a legacy SQL editor query that filtered on '{{ date_range.start }}' and '{{ date_range.end }}' into an AI/BI dashboard dataset. The new parameter has the keyword date_param and the type Date Range, and viewers must be able to choose All. Which WHERE clause should the dataset use?

    Sources1

    5.Connecting parameters to filter widgets

    Viewers only interact with a parameter once it is bound to a filter widget. Click Add a filter (field/parameter), place the widget on the canvas and choose a filter type. Parameter filters offer single value, multiple values, date picker and date range. Then add the parameter under Parameters in the configuration panel. In the tutorial, the author selects segment from the Marketing segment dataset, and the widget then shows the default value from the Data tab. When a viewer changes the value, the queries that use the parameter run again.

    A plain single-value filter has a usability problem. Viewers have to know which values exist and type them with exactly the right case and spelling. The fix is a query-based parameter, which combines a field filter and a parameter filter in one widget. Create a second dataset that lists the valid choices, for example SELECT DISTINCT c_mktsegment FROM samples.tpch.customer, which returns the five market segments. Then add that dataset's c_mktsegment field under Fields on the same widget. The widget becomes a dropdown filled from the data, and the selected value is still passed into :segment.

    Where the pieces of a query-based parameter are configured
    Widget settingPoints toRole
    Parameterssegment in the Marketing segment datasetReceives the value the viewer selects
    Fieldsc_mktsegment in the Segment choice datasetSupplies the list of choices in the dropdown

    Checkpoint 6 of 6· Match them up

    An author builds a query-based parameter so that viewers pick a market segment from a dropdown instead of typing one. Match each piece of the setup to the job it does.

    Tap a term, then the definition that fits it.

    Sources23

    Practise it for real

    Build a dashboard whose bar chart is filtered by a market-segment parameter chosen from a dropdown that is filled from the data.

    1. 1.Create a new dashboard. In the Data tab, click Add SQL dataset, run SELECT * FROM samples.tpch.customer and rename the dataset Marketing segment.

      Why: The parameter has to be declared inside a dataset's query.

      You should see: The customer rows are returned and the dataset shows its new name.

    2. 2.Append WHERE c_mktsegment = :segment, type BUILDING in the field that appears below the query, and run it again.

      Why: Running with a default value tests the query and saves the default.

      You should see: Only BUILDING customers are returned.

    3. 3.On the canvas, add a bar visualization with c_nationkey on the X-axis (Categorical) and SUM of c_acctbal on the Y-axis.

      Why: Every widget on the dataset is affected by the parameter.

      You should see: The chart shows only BUILDING-segment balances.

    4. 4.Add a filter (field/parameter), set it to Single value, title it Segment, and under Parameters choose segment from Marketing segment.

      Why: Binding the parameter to a filter widget lets viewers change it.

      You should see: The filter shows BUILDING as its value.

    5. 5.Add a second dataset, SELECT DISTINCT c_mktsegment FROM samples.tpch.customer, named Segment choice. Then on the filter, under Fields, choose its c_mktsegment field.

      Why: A field from a second dataset turns the parameter into a query-based dropdown.

      You should see: Clicking the filter shows a dropdown of the five segments, and picking one redraws the chart.

    Stuck? Get a nudge

    If the chart doesn't change when you pick a new segment, check that the widget's Parameters entry points to segment in Marketing segment and not to the Segment choice dataset.

    Sources

    (3)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “AI/BI dashboard parameters let you substitute different values into dataset queries at runtime.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “Parameters can be used with filter widgets to make dashboards interactive or with visualization widgets to make datasets easier to reuse.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “You must have at least CAN EDIT permissions on the draft dashboard to add a parameter to a dashboard dataset.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “Supported types include String, Date, Date and Time, Numeric. The default type is String.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “The Numeric datatype allows you to specify between Decimal and Integer. The default numeric type is Decimal.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “Running the query also saves the default value.”
      ↩︎ Testing with default values
      “the default value from the Data tab is used unless the widget specifies a different default.”
      ↩︎ Testing with default values
      “Databricks queries the dataset schema to populate the widget configuration editor.”
      ↩︎ Testing with default values
      “If the ARRAY_CONTAINS function is used without enabling multiple selections, an error occurs.”
      ↩︎ Multi-select parameters with array_contains
      “If "All" is selected, the parameter is NULL and all rows are returned (no filtering is applied).”
      ↩︎ Multi-select parameters with array_contains
      “you create two parameters that are designated by .min and .max suffixes”
      ↩︎ Date-range parameters and relative defaults
      “Enter the Keyword and Display name. Do not include .min or .max suffixes.”
      ↩︎ Date-range parameters and relative defaults
      “Queries that allow multiple selections must include an ARRAY_CONTAINS function in the query.”
      ↩︎ Exam trap 1
      “particularly with parameterized queries that use the IDENTIFIER clause, the dataset query can fail to run with the default parameter values”
      ↩︎ Exam trap 2
      “to configure a default range of the last 30 days, set the .min value to now-30d/d and the .max value to now/d.”
      ↩︎ Prediction
      “use a BETWEEN clause with .min and .max values and include an OR :parameter IS NULL condition to handle All selections”
      ↩︎ Checkpoint
    2. 2.
      “Parameters substitute values at runtime and always require the associated query to rerun.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “With parameters, you can place filter conditions anywhere in the query, such as before a join rather than after it.”
      ↩︎ Declaring a parameter in a dashboard dataset
      “Parameter filters: Single value, multiple values, date picker, date range.”
      ↩︎ Connecting parameters to filter widgets
      “Query-based parameters combine a field filter and a parameter filter in a single widget.”
      ↩︎ Connecting parameters to filter widgets
    3. 3.
      “It also requires that users match the case and spelling when entering the desired parameter value.”
      ↩︎ Connecting parameters to filter widgets
      “Click Segment choice, then click the field name c_mktsegment.”
      ↩︎ Connecting parameters to filter widgets

    Spotted a mistake, or was something unclear? Tell us.