浏览报表“筛选器”窗格Take a tour of the report Filters pane

本文将深入介绍报表“筛选器”窗格。This article takes a deep look at the report Filters pane. 你将在“编辑视图”和 Power BI 报表的“阅读视图”中看到窗格。You'll see the pane in Editing View and in Reading View for Power BI reports.

在 Power BI 中可以使用多种不同的方式筛选数据,我们建议首先阅读 关于筛选器和突出显示There are many different ways to filter data in Power BI and we recommend first reading About filters and highlighting.

使用刷选器Working with filters

可在编辑视图或阅读视图中打开报表。Reports can be opened in Editing view or Reading view. 在“编辑视图”中,报表所有者可 向报表添加筛选器,这些筛选器将与报表一起保存。In Editing View, report owners can add filters to a report and those filters are saved with the report. 在“阅读视图”中查看报表的人员可与这些筛选器进行交互,但不能将筛选器更改保存到该报表。People viewing the report in Reading view can interact with the filters, but cannot save filter changes to the report.

“阅读视图”中的筛选器Filters in Reading View

在“阅读视图”中打开报表时,“筛选器”窗格显示在报表画布的右侧。When a report is open in Reading View, the Filters pane displays along the right side of the report canvas. 如果未看到窗格,请选择右上角的箭头以将其展开。If you don't see the pane, select the arrow in the top-right corner to expand it.

在此示例中,我们选择了具有 6 个筛选器的视觉对象。In this example, we've selected a visual that has 6 filters. 报表页也有筛选器,列于“页面级筛选器”标题下。The report page also has filters, listed under the Page level filters heading. 有一个钻取筛选器,整个报表也有筛选器:“FiscalYear”为 2013 或 2014。There is one Drillthrough filter, and the entire report has a filter too: FiscalYear is 2013 or 2014.

部分筛选器旁有“全部”字样,这意味着所有值都包含在一个筛选器中。Some of the filters have the word All next to them and this means that all values are being included in the filter. 例如,下面的屏幕截图中的 Chain(All) 告诉我们该报表页包括有关所有存储链的数据。For example, Chain(All) in the screenshot below tells us that this report page includes data about all the store chains. 从另一方面来说,“FiscalYear 为 2013 或 2014”的报表级别筛选器告诉我们该报表仅包括 2013 和 2014 的财政年的数据。On the other hand, the report level filter of FiscalYear is 2013 or 2014 tells us that the report only includes data for the fiscal years of 2013 and 2014.

查看此报表的任何人都可与这些筛选器进行交互。Anyone viewing this report can interact with these filters.

  • 悬停鼠标并选择筛选器旁的箭头可查看该筛选器的详细信息。view the details of the filter by hovering and selecting the arrow next to the filter.

  • 更改筛选器,例如,将 Lindseys 更改为 Fashions Directchange the filter, for example, change Lindseys to Fashions Direct.

  • 选择筛选器名称旁的 x 可删除筛选器。delete the filter by selecting the x next to the filter name.

    删除筛选器将其从列表删除,但并不会删除报表的数据。Deleting a filter removes it from the list but does not delete the data from the report. 例如,如果删除 FiscalYear 为 2013 或 2014 筛选器,财政年数据仍将保留在报表中,但将不再筛选为仅显示 2013 和 2014,而是显示数据包含的所有财政年。For example, if you delete the FiscalYear is 2013 or 2014 filter, fiscal year data will still remain in the report but it will not longer be filtered to show only 2013 and 2014; it will show all fiscal years the data contains. 但是,一旦删除筛选器后,将无法再对其修改,因为它已从列表删除。However, once you delete the filter, you won't be able to modify it again since it is removed from the list. 更好的选择是通过选择橡皮擦图标来清除筛选器 A better option is to clear the filter by selecting the eraser icon .

“编辑视图”中的筛选器Filters in Editing View

在“编辑视图”中打开报表时,“筛选器”窗格显示在“可视化效果”窗格底部中的报表画布右侧。When a report is open in Editing View, the Filters pane displays along the right side of the report canvas in the bottom half of the Visualization pane. 如果未看到窗格,请选择右上角的箭头以将其展开。If you don't see the pane, select the arrow in the top-right corner to expand it.

..

如果画布中未选择任何视觉对象,则“筛选器”窗格将仅显示适用于整个报表页面或整个报表的筛选器以及任何钻取筛选器(如果已设置有)。If no visual is selected in the canvas, then the Filters pane displays just the filters that apply to the entire report page or entire report, and any drillthrough filters(if any have been set). 在以下示例中,未选择视觉对象,并且没有页面级筛选器或钻取筛选器,但存在报表级筛选器。In the example below, no visual is selected and there are no page level or drillthrough filters but there is a report level filter.

如果画布中选择了一个视觉对象,则你还会看到仅适用于该视觉对象的筛选器:If a visual is selected in the canvas, you will also see the filters that apply to just that visual:

若要显示特定筛选器的选项,请选择该筛选器名称旁的向下箭头。To display options for a particular filter, select the down arrow next to the filter name. 在以下示例中,报表级筛选器被设置为 2013 和 2014。In the example below, the report level filter is set to 2013 and 2014. 这是基本筛选的一个示例。And this is an example of basic filtering. 若要显示高级选项,请选择高级筛选To display the advanced options, select Advanced Filtering.

清除筛选器Clear a filter

在高级或基本筛选器模式下,选择橡皮擦图标 以重置筛选器。In either advanced or basic filtering mode, select the eraser icon to reset the filter.

添加筛选器Add a filter

  • 在编辑视图中,通过从“字段”窗格中选择一个字段并将其拖动到相应的筛选器(其中你会看到“将字段拖至此处”字样),从而将筛选器添加到视觉对象、页面、钻取或报表。In editing view, add a filter to a visual, page, drillthrough, or report by selecting a field from the Fields pane and dragging it into the appropriate filter well, where you see the words Drag fields here. 将字段作为筛选器添加后,使用基本筛选和高级筛选控件对其进行微调(如下所述)。Once a field has been added as a filter, fine-tune it using the Basic filtering and Advanced filtering controls (described below).

将新字段拖动到视觉对象级筛选器区域不会将该字段添加到视觉对象,但是它的确允许你使用此新字段来筛选该视觉对象。Dragging a new field into the Visual level filter area does not add that field to the visual, but it does allow you to filter the visual with this new field. 在以下示例中,“”作为新筛选器添加至视觉对象中。In the example below, Chain is added as a new filter to the visual. 请注意,在使用基本或高级筛选控制前,仅将“”添加为筛选器不会更改视觉对象。Notice that simply adding Chain as a filter does not alter the visual until you use the Basic or Advanced filtering controls.

![](media/power-bi-how-to-report-filter/power-bi-visual-filter.gif)
  • 用于创建可视化效果的所有字段都还可用作筛选器。All the fields that are used to create a visualization are also available as filters. 首先,选择视觉对象以将其激活。First, select a visual to make it active. “视觉对象”窗格和“筛选器”窗格(在“视觉对象级别筛选器”标题下方)中列出了视觉对象中正在使用的字段(如果你处于编辑视图)。The fields that are being used in the visual are listed in the Visualizations pane (if you are in Editing view) and in the Filters pane under the Visual level filters heading.

    使用基本筛选和高级筛选控制(如下所述)对任意这些字段进行微调。Fine-tune any of these fields using the Basic filtering and Advanced filtering controls (described below).

筛选器类型:文本字段筛选器Types of filters: text field filters

列表模式List mode

勾选复选框将选择或取消选择值。Ticking a checkbox either selects or deselects the value. 全部复选框可用于切换所有复选框的状态(“启用”或“取消”)。The All checkbox can be used to toggle the state of all checkboxes on or off. 这些复选框表示该字段的所有可用值。The checkboxes represent all the available values for that field. 调整筛选器时,重述将更新以反映你的选择。As you adjust the filter, the restatement updates to reflect your choices.

注意,现在重述的表述方式“为 Amarilla 或 Carretera”Note how the restatement now says "is Amarilla or Carretera"

高级模式Advanced mode

选择高级筛选以切换到高级模式。Select Advanced Filtering to switch to advanced mode. 使用下拉控件和文本框来标识要包括哪些字段。Use the dropdown controls and text boxes to identify which fields to include. 通过在之间选择,可以生成复杂的筛选器表达式。By choosing between And and Or, you can build complex filter expressions. 设置所需值后,选择应用筛选器按钮。Select the Apply Filter button when you've set the values you want.

筛选器类型:数值字段筛选器Types of filters: numeric field filters

列表模式List mode

如果这些值是有限的,则选择字段名称将显示一个列表。If the values are finite, selecting the field name displays a list. 请参阅前述文本字段筛选>列表模式来帮助使用复选框。See Text field filters > List mode above for help using checkboxes.

高级模式Advanced mode

如果这些值有限或表示一个范围,则选择字段名称将打开高级筛选器模式。If the values are infinite or represent a range, selecting the field name opens the advanced filter mode. 使用下拉列表和文本框来指定想要查看的值的范围。Use the dropdown and text boxes to specify a range of values that you want to see.

通过在之间选择,可以生成复杂的筛选器表达式。By choosing between And and Or, you can build complex filter expressions. 设置所需值后,选择应用筛选器按钮。Select the Apply Filter button when you've set the values you want.

筛选器类型:日期和时间Types of filters: date and time

列表模式List mode

如果这些值是有限的,则选择字段名称将显示一个列表。If the values are finite, selecting the field name displays a list. 请参阅前述文本字段筛选>列表模式来帮助使用复选框。See Text field filters > List mode above for help using checkboxes.

高级模式Advanced mode

如果字段值表示日期或时间,可以使用“日期/时间”筛选器指定开始/结束时间。If the field values represent date or time, you can specify a start/end time when using Date/Time filters.

后续步骤Next steps

报表中的筛选器和突出显示Filters and highlighting in reports
在报表的“阅读视图”中与筛选器和突出显示交互Interact with filters and highlighting in report Reading View
在报表“编辑视图”中创建筛选器Create filters in report Editing View
更改报表视觉对象相互交叉筛选和交叉突出显示的方式Change how report visuals cross-filter and cross-highlight each other

了解有关 Power BI 中的报表的详细信息Read more about reports in Power BI
Power BI - 基本概念Power BI - Basic Concepts

更多问题?More questions? 尝试参与 Power BI 社区Try the Power BI Community