How To Create Filters In Power Bi

For a report in Power BI to be representative we have to make sure that we are showing the data that is necessary and adds value. A key factor to achieve this is the creation of filters in your reports.

Creating a filter in Power BI allows us to select the data that we want to show in a report, on a specific page of a report or even on a specific visual object. That is, it allows us to make a segmentation between all the data that we have and select those that we want to represent.

In this article, we will see how to create a filter in Power BI based on a practical example. In our case, we are going to have the sales and costs of the last 3 years of a business and, based on this data, we will see how to filter them in two different ways.

How to Create Filters in Power BI

There are two different methodologies for creating filters in Power BI. On the one hand, it can be done through visualization and, on the other hand, it can be done through the filter panel that we have available in Power BI. In this case, we are going to explain the two ways to do it taking into account the report that we can see in the following image.

As we entered before, the report shows us an analysis of sales and costs over three years. With the creation of filters, in this case, our objective is for the report to show those data that refer only to the year we wish to analyze.

Create Filters in Power BI Through a Visualization

One possibility that we have in Power BI to create this filter is to do it through a visualization (visual object). To do this, we have to select in the visualizations panel the visual object that is called data segmentation.

Once we select this visualization, we will see that a visual object is generated in the report. So what we need to do next is add a data field to this visualization. In our case, we will add the “Year” data field, since we want to filter according to that specific aspect.

Simply by doing this, we would have already generated our filter on this page of the report that allows us, in this case, to segment the report data (sales and costs) according to the year.

What we must bear in mind is that when we generate this type of filter, by default it is segmenting all the existing visualizations on the report page, that is, it is filtering the entire page. Therefore, if we select “2020” in the filter, all the objects would show us only the data corresponding to that specific year.

What If We Want To Filter A Specific Visualization? 

There is a solution for it. In Power BI we can edit the interaction that exists between different visual objects, therefore, we can specify that the filter does not interact with any of our visualizations.

To do this, we must select the filter created and in the format tab click on “Edit interactions”. We will automatically see that in the upper right part of each one of the visualizations a “prohibited” icon appears. By clicking on this icon we eliminate the interaction between the filter and that particular visual object.

Once the interactions have been edited, we click on “Edit interactions” again and our configuration is saved.

As we can see in the previous image, in this case, the filter would only affect the column chart, since we have disabled the interaction with the pie charts.

Create filters in Power BI from the filter panel

In this second option, it is not necessary to create a visual object, but we can generate the filters from a panel available in the tool.

The first step to do this is to activate this filter panel. To do this, we must go to the “View” tab and in the Show Panels section, select “Filters”. By doing this, the panel will automatically appear on the right side of our screen.

Getting Started with Power BI for Free | Microsoft Power BI

If we look closely, in this panel we have two options: Filters for this page (to segment data on the page we are on) and Filters for all pages (to segment data throughout the report).

To generate this filter we should only drag the data field in this panel that we have activated. In our case, we are going to drag the data field “Year” and we are going to indicate that we want the value to be “2020”.

Using This Method Can We Filter A Specific Object? 

The answer is yes. We have detailed that in the filter panel we have two options available, but the truth is that, if we select a visualization, a third option appears in the panel to filter that specific visual object.

In this third option “Filters of this visual object” we can drag the data fields that we want to exclusively segment that visualization.

To know if our visual objects are filtered or not, we can go over them and click on the funnel icon that appears in the upper right part of each visualization. A pop-up will appear informing us of the filters that are affecting that visual object.

Discover all the Features of Power BI

As we have seen, by creating filters in Power BI we can segment our reports to observe the data that adds value and is necessary for decision making. Just like this functionality, Power BI has many others that also help us to be more efficient in data analysis.

Discover our complete Power BI consulting and learn how to get the most out of your Business Intelligence tool. Present your data clearly and visually to draw better conclusions in your reports.

Al Rafay Global is a consultancy company that is specialized in Microsoft tools. We accompany you in every step of your training to ensure that you maximize productivity.