Edit

Share via


Add a filter to a report in Power BI

APPLIES TO: Power BI Desktop Power BI service

This article explains how to add a visualization filter, page filter, or report filter to a report in Power BI. You need to be able to edit a report to add filters. The examples in this article are in the Power BI service, and the steps are almost identical in Power BI Desktop.

Screenshot of a Power BI service report, with the Filters pane highlighted to the side of the canvas. Filters are listed for a visual and the page.

Levels of filters in the Filters pane

Whether you use Power BI Desktop or the Power BI service, the Filters pane appears along the right side of the report canvas. If the Filters pane is hidden, go to the upper-right corner and select the two greater-than symbols (>>) to expand the pane.

You can set filters at three levels for a report:

This article explains how to set filters at these levels.

The examples in this article use the Retail Analysis sample. If you want to install this sample and follow along, see Retail Analysis sample.

Add a filter to a visual

Visuals have two kinds of filters:

  • The fields that are in a visual are automatically filters for that visual.
  • You can also use fields in your filter that aren't displayed in the visual. As the report designer, you can identify a field that isn't already in the visual. Then you can add that field directly to the bucket for visual-level filters.

Filter with a field that's not in the visual

  1. In Power BI Desktop, select Report view .

    Screenshot of Power BI Desktop. In the upper-left corner, just below the ribbon, the Report view button, which pictures a bar chart, is highlighted.

  1. Open the Filters, Visualizations, and Data panes, if they're not already open.

    Screenshot of a Power BI service report in edit mode. The Filters, Visualizations, and Data panes are next to the canvas and are highlighted.

  2. To make a visual active, select it. In this example, the scatter chart on the Overview page is selected. The Visualizations pane lists all the fields in the visual. The Filters pane also lists the fields, under the Filters on this visual heading.

    Screenshot of a report in edit mode. A scatter chart is selected. In the side panes, the filters on this visual and the values are highlighted.

  3. On the Data pane, locate the field that you want to add as a new visual-level filter. Drag that field to the Filters pane, into the area under Filters on this visual that's labeled Add data fields here. In this example, the Category field is added to that area.

    Screenshot of a report in edit mode. The Category field is highlighted in the Data pane and in the Filters pane, among other visual-level filters.

    The Category field isn't added to the visualization itself.

  4. On the Filters pane, go to the filter for the Category field, and then select 030-Kids. The scatter chart is updated when the filter is applied, but the other visuals stay the same.

    Screenshot of a report in edit mode. The scatter chart shows sales data only for the 030-Kids category. Only that category is selected in the filter.

    If you save your report with this filter, report readers can interact with the Category filter in Reading view by selecting or clearing values.

    If you drag a numeric column to the Filters pane to create a visual-level filter, the filter is applied to the underlying rows of data. For example, you can take the following steps:

    1. Add a filter on the TotalUnits field.
    2. On the Filters pane, under Show items when the value, select is greater than, and then enter 10,000.
    3. Select Apply filter.

    The chart is updated to show data for products with more than 10,000 units sold.

Add a filter to an entire page

To apply a filter to all visuals on a page, you can add a page-level filter.

  1. In Power BI Desktop, open the Retail Analysis report.

  2. Select Report view , and then go to the District Monthly Sales page.

    Screenshot of Power BI Desktop. In the upper-left corner, directly below the ribbon, the Report view button pictures a bar chart and is highlighted.

  1. Open the Filters, Visualizations, and Data panes, if they're not already open.

  2. On the Data pane, locate the field that you want to add as a new page-level filter. Drag that field to the Filters pane, into the area under Filters on this page that's labeled Add data fields here. In this example, the District Manager field is added to that area.

    Screenshot of a report in edit mode. The District Manager field is highlighted in the Data pane and Filters pane, among other page-level filters.

  3. On the Filters pane, go to the filter for the District Manager field. Under Filter type, select Advanced filtering or Basic filtering, and then set the values or conditions you want to use in your filter.

    All the visualizations on the page are redrawn to reflect the change.

    If you save your report with the filter, report readers can interact with the filter in Reading view by selecting or clearing values.

Add a report-level filter for an entire report

To apply a filter to all visuals in a report, you can add a report-level filter.

  1. In Power BI Desktop, select Report view .

    Screenshot of Power BI Desktop. In the upper-left corner, just below the ribbon, the Report view button pictures a bar chart and is highlighted.

  1. Open the Filters, Visualizations, and Data panes, if they're not already open.

  2. On the Data pane, locate the field that you want to add as a new report-level filter. Drag that field to the Filters pane, into the area under Filters on all pages that's labeled Add data fields here.

  3. Select the values you want to use in your filter.

    The visuals on the active page, and on all pages in the report, change to reflect the new filter. If you save your report with the filter, report readers can interact with the filter in Reading view by selecting or clearing values.

Reset to default values

Filters persist from one session to the next. As a result, when you make changes in filters, slicers, or data views in the Power BI service and then leave your report, Power BI retains your changes. When you return to the report, you can pick up where you left off.

If you don't want your filter changes to persist, you can reset the report to its default values. In Reading view in the Power BI service, go to the top menu bar, and then select Reset to default .

Screenshot of the menu bar in the Power BI Service in Reading view. The green Reset to default button is highlighted and shows an arrow circling back.

Keep in mind that as the report creator, you can save filters with the report. Those filters then become the default filter state for all your report readers. When they select Reset to default , they return to that default state.

Considerations and troubleshooting

  • If the Data pane isn't visible in the Power BI service, make sure you're in report Editing view.
  • In the Power BI service, you can make changes to the filters when you're in Reading view. If you want to return to the default settings, go to the top menu bar, and then select Reset to default . If you're the report author, whatever filters are in place when you save the report become the default filter settings.