Skip to main content

Use dashboard filters

Dashboard filters let viewers focus on specific data in visualizations. You can design filters to be interactive, enabling viewers to adjust values dynamically, or static, where the dashboard author predefines values.

Interactive and static widget-level filters

Filters can be interactive or static, each serving different purposes:

  • Interactive filters: Allow viewers to adjust values dynamically, applying the selected filter to all visualizations on the same page that share the same dataset.
  • Static filters: Display a predefined view of the dataset by the dashboard author. These apply only to the widget where they are configured, enabling unique views of the same dataset across widgets. See Static widget filters.

Filter widgets

Filter widgets are interactive elements on the dashboard canvas that apply filters to dataset fields or parameter values.

note

Query-based parameters combine a field filter and a parameter filter in a single widget. For more information, see Query-based parameters.

Set default filter values

Default values are used when the dashboard is refreshed without selecting a new filter value. To set a default value, select a value from the Default value drop-down in the filter widget’s configuration settings.

Filters apply to the entire dataset. For small datasets, filters are applied in the browser to optimize performance. If the dataset is larger, the filter is added to the query that is run in the SQL warehouse. See Dataset optimization and caching.

Filter on fields

Field filters narrow data by specific dataset fields. For example, a field filter might limit data to a particular date range based on a date field in a dataset. Field filters can be connected to one or more datasets, allowing dynamic changes to available filter values based on selections. To connect a filter to fields from more than one dataset, add multiple Fields, up to one per dataset. The filter applies to all visualizations built on the selected datasets. Selecting a value for one filter dynamically changes the available values shown in the drop-down menus for other filters. The following image shows a filter configuration panel set to filter on two fields.

Filter configuration shows two datasets selected. The widget drop-down shows values from both datasets

Filter on parameters

Parameter filters modify the SQL query directly, offering dynamic query adjustments. Filters can be connected to one or more parameters. To connect a filter to more than one parameter, add multiple Parameters in the filter configuration panel. A default value set in a filter widget overrides the default value set in the query editor. If a filter is connected to a parameter, it runs a query against the SQL warehouse, regardless of the dataset size. See Work with dashboard parameters.

You can set parameter values to accept one of the following data types:

  • String
  • Numeric
    • Integer
    • Decimal
  • Date
  • Date and Time
  • Date Range
  • Date and Time Range

Should I filter on a field or a parameter?

The following table compares filtering directly on dataset fields with filtering using parameters.

Filtering type

Description

Performance

Versatility

Filtering on a field

Applied directly to dataset fields without modifying the dataset.

Typically faster. Small datasets can be filtered in the browser. Large datasets are filtered by re-running the query with the filter predicate applied. See Dataset optimization and caching.

Limited to filtering resolved dataset results. Cannot be used in subqueries or in custom conditional logic.

Filtering on a parameter

Substitutes values directly into the dataset query at runtime.

Requires re-running the query whenever the parameter value changes.

Can be used in subqueries, conditional logic, or to modify query structure.

Filter types

Field and parameter filters support various filter types:

  • Field filters: Single value, multiple values, date picker, date range picker, text entry, range slider.
  • Parameter filters: Single value, multiple values, date picker, date range.

For examples that show how to configure different filter types, see Dashboard filter types.

Filters in published dashboard URLs

Published dashboards store field filters and parameter selections in the URL. This allows users to bookmark or share a dashboard with specific filter configurations. When a user opens the URL, the dashboard loads with those filter values already applied.

Filter identifiers are not stored as named values. Each filter is identified by a combination of the page name value and widget name value, separated by a tilde (~). These values are automatically generated by default. The filter identifier and value are passed as part of the URL to load the dashboard with the specified filter selection.

note

The name key appears in the serialized file that defines the dashboard and is not accessible from the Databricks UI. It is separate from the "displayName" value, which defines the page name shown in the UI. See Edit a dashboard file.

The following example shows the structure of a dashboard URL with a selected filter value:

<databricks-instance>/dashboardsv3/<dashboard-id>/published?o=<workspace-id>&f_<page-name>~<widget-name>=<filter-value>
  • The first part of the URL identifies the published dashboard. See Dashboard URL and ID.
  • The section that identifies the filter starts with f_ and is followed by the page-name and widget-name, separated by a tilde (~).
  • The value to the right of the equals sign (=) is the selected filter value.

You can modify the filter values in the URL to control which filters are applied. The page-name and widget-name values are automatically generated but can be edited when working with a serialized lvdash.json file. See Edit a dashboard file.

Access and set filter values in the URL

The following example shows a URL for a published dashboard that includes a selected filter value:

<databricks-instance>/dashboardsv3/<dashboard-id>/published?o=<workspace-id>&f_53eadf26~3490f286=10013

This example references a dashboard with three filters: Time Range, Pickup Zip, and Dropoff Zip. Only the Pickup Zip filter is assigned a value. In the URL, it has been set to 10013 using the identifier f_53eadf26~3490f286.

To create a dashboard similar to the one used in this example, see Create a dashboard.

Specify relative date range values in the URL

If a relative time filter is used, such as Last 5 minutes or Last 12 hours, the corresponding value appears in the URL.

The following example shows a URL with the Last 12 hours selected.

<databricks-instance>/dashboardsv3/<dashboard-id>/published?o=<workspace-id>&f_53eadf26~3490f286=now-12h

In this case, the filter identifier f_53eadf26~3490f286 is set to the relative value now-12h.

Static widget filters

Static widget filters can be used to present different views of the same dataset on a canvas. Unlike dashboard filters, static widget filters apply only to the visualization widget where they are configured. These filters are static and cannot be changed by dashboard viewers.

Example use case

Suppose you are creating a sales dashboard that analyzes regional performance. You use a dataset with sales data for all regions. By applying static widget filters, you can configure one widget to display sales for Region A and another widget to display sales for Region B. This approach allows viewers to compare regional performance side by side, even though both widgets draw from the same dataset. Because static widget filters are fixed, viewers cannot modify the filters, ensuring the dashboard always presents a consistent view of the data.

Add a static widget filter

To add a static widget filter to a visualization:

  1. Add a visualization widget to the draft dashboard canvas.

  2. With the new widget selected, choose a dataset from the Dataset drop-down in the configuration panel.

  3. Click Show filters. A Filter fields option appears under the dataset title. For datasets that include parameters, a Parameters section also appears.

    A visualization configuration panel showing the option to choose a parameter.

To add a field filter, do the following:

  1. Click the plus sign to the right of the Filter fields heading and choose a field from the drop-down menu.
  2. By default, the filter value is set to All. Use the drop-down menu to choose a new value. Navigate away from the drop-down menu to show the visualization with the new filter applied.
  3. Review your dashboard.

To learn about setting a static widget-level parameter, see Static widget parameters.