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 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
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.
Filters in published dashboard URLs
Field filters and parameter selections are stored in the URL, enabling users to bookmark and share dashboards with specific configurations. When accessed through the link, the dashboard opens with the selected filter values already applied to the visualizations.
Filter selections are not stored as named values. Instead, they are converted to unique identifiers embedded within the URL string. These identifiers are set to values in the URL, allowing you to pass specific filter selections directly into the URL to load dashboards with those values selected.
Access and set filter values in the URL
The following example shows a URL that points to a published dashboard. To create a similar example dashboard, see Create a dashboard.
The example dashboard includes three filters: Time Range, Pickup Zip, and Dropoff Zip. In the example URL, the selected Pickup ZIP value has been selected.
<databricks-instance>/dashboardsv3/<dashboard-id>/published?o=<workspace-id>&f_01ef60cd2a3c11818750488d57e7a1bb=10013
At the end of the URL, observe that the filter identifier in this example is the string f_01ef60cd2a3c11818750488d57e7a1bb
, which is set to the value 10013
.
Specify relative date range values in the URL
When particular date values are selected, they appear in the URL. You can also specify the relative date values like Last 5 minutes or Last 12 hours, for example.
The following example shows a URL with the relativoverrides*Last 12 hours** selected.
<databricks-instance>/dashboardsv3/<dashboard-id>/published?o=<workspace-id>&f_01ef60cd29f81d1aacc19a7312fb10a4=now-12h
At the end of the URL, observe that the filter identifier in this example is the string f_01ef60cd29f81d1aacc19a7312fb10a4
, which is set to the 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:
Add a visualization widget to the draft dashboard canvas.
With the new widget selected, choose a dataset from the Dataset drop-down in the configuration panel.
Click Show filters. A Filter fields option appears under the dataset title. For datasets that include parameters, a Parameters section also appears.
To add a field filter, do the following:
- Click the plus sign to the right of the Filter fields heading and choose a field from the drop-down menu.
- 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.
- Review your dashboard.
To learn about setting a static widget-level parameter, see Static widget parameters.