

Moreover, only the Rows section of the matrix visual defines the granularity of a visual filter based on a measure. However, looking at the report in a static way it might be counter-intuitive.

This is clear when navigating from one level to another. However, if one drills up the matrix to only show the year level, the filter is still applied to both the year and month columns, evaluating the Revenues measure for every month before applying the filter condition. This was intuitive because both year and month were displayed in the visual. In the previous example, the cardinality is year and month. The matrix visual applies a measure filter at the cardinality defined by the rows of the matrix itself. Indeed, those months display a Revenues value under or equal to 10. In the Visual Level Filters section, the Revenues measure can have a filter as in the following example that requires Revenues to be greater than 10.Īs one might expect, by applying this filter the visualization reduces the rows displayed and filters out the months between January 2018 and October 2018. A matrix without any filter shows the following data.
#Microsoft power bi desktop filter data how to
How to apply a visual level filter in Power BIĬonsider a simple data model reporting revenue by date. The goal of this article is to explain how to use a measure as a filter in a Power BI visualization, controlling the granularity and the possible side effects, all the while writing measures that will provide the correct results and avoiding unexpected behaviors. However, this technique gets different results depending on the visualizations used in the report, and it can have unexpected or counter-intuitive side effects in the measures used in the report. In Power BI it is possible to create a measure filter working at a granularity that is different from the one shown in a report by the visual. This is the reason why measures can only be used as filters in visual level filters. The user interface of Power BI does not feature a specific tool to specify a target for the filters defined at the page and report levels. A visual has an implicit definition of the target of the filter made by the columns (or by a subset of the columns) used in the visual. The Visual Level Filters section is the only one accepting a measure as a filter, whereas Page Level Filters and Report Level Filters only accept columns as a filter.Ī measure used as a filter requires a target for the filter itself. This section can include additional filters over columns and measures. Every visualization in Power BI has a Visual Level Filters section that by default includes all the columns and measures included in the visualization.
