Skip to main content

Types of Filters in Power BI

In today's blog, we will take a deep dive into the basic functionality of Power BI. We will talk about the types of filters available in the Power BI whether in the query editor or at the visualization level. Let's start with the purpose of using filters that is limiting the rows on the basis of a condition or restrict the data which you don't want to showcase in your visualization. There are many types of filters available in Power BI. We will start with the filters available in the query editor. I am considering the sample superstore data. So, I have imported the Orders and Returns table and we will be applying the filter on the order date.


When we select the date filters it will lead to a pop-up where you can select basic and advanced filtering currently I am selecting the advanced version. The filter will limit the data for a particular duration as you can see in the image below.

You can remove the filter just by selecting the clear filter. Just to check the code of the filter you can select the column and you can see the code.


There are many options for filters in the query editor we will now move to the visualization filters. There are mainly two filters- visual-level filters and page-level filters. As the name suggests if you apply a filter on the page level then it is applied on all the visualization available on that page whilst at the visual level you can restrict the data on that particular visual.


If you select the visual level filters there are 3 types associated with it one is basic filtering, advanced filtering, and top N. Basic filtering just give a simple option to restrict a particular data for example if we put a category in the filter and we only want to showcase furniture then basic filtering is a great option. When it comes to advanced filtering then it is the relative filtering based on a condition like greater than a particular number and top N provides a list of top products/categories (N represents the number).


You can apply basic or advanced filters together for different fields. For instance, we will select only the furniture category also where the profit is greater than 5000 USD and doesn't give blank values.



Now we will consider the include and exclude filters. For that, we will create a bar graph for different regions showcasing their sales. We want to exclude the west region from that graph. To do so right-click on the bar graph and you can see options for include and exclude.


There are many filters other than this but the idea of this blog is just to a gist of filters. But if you google about filters there is a common question how filters are different from a parameter? If you consider the parameter it is mainly applied to the query editor and it is an integral part of query folding so if I apply that particular parameter it will affect the dataset and hence limit the data size at the back end. It will be applied throughout your report, unlike filters which can be either applied on the page level or the visual level.


Thanks for Reading  Let's connect on  LinkedIn. For more such blogs do follow us.


 

Comments

Popular posts from this blog

Ultimate Beginners Guide to DAX Studio

There are zillions of external tools available with Power BI but DAX Studio is one of the most commonly used tools to work with DAX queries. It is a perfect tool to optimize the DAX and the data model. In this blog let's shed some light on the basic functionalities that can take your report to the next level. ARE YOU READY?  To start you will need the latest version of the DAX Studio. You can download it from their website . Don't worry you don't have to pay for the license. Fortunately, DAX Studio is a free tool As a BI Developer, I am using DAX Studio regularly. Based on my experience I use it for several purposes but in this blog, I will highlight the most common ones. Extracting a dump of all the measures used in your PBIX. Why do we need to do this? It can be used for documentation purposes also sometimes we try to reuse the DAX and such a dump comes in handy in this scenario. How to achieve it? Open the DAX Studio it is located under the external tools once you open t

Append v/s Merge in Power BI

Let's discuss another problem of the week. As a Power BI user, there are times when you want to combine queries. What are the ways to do so? In most cases, you can attain it by using either append or merge and both serve different purposes. Let's understand what do these terms mean in Power BI and how they are functionally different from each other.  It is quite common to get data from various sources and you need to combine those data depending on a particular column which is common in both tables so that you can add extra information or column to your big table. In such cases, we use merge queries. How to perform merge queries? For instance, I am considering Sample Superstore data and we will merge the returns table to the order table. You will find both merge and append in the home tab in extreme right in the power query editor. ProTip - You will find two options when you click on the drop-down in merge which are merge queries and merge queries as new. When you use merge que

Use Relationship in DAX

Data modeling is an essential part of creating perfect visuals. While creating complex data models there can be a case where you can find an inactive relationship represented by dotted lines and it occurs because you already have an active relationship between the two tables. But as a developer, you need to use both the relationship. How can it be done? You can use "Use Relationship" in such cases. Use relationship can be added to your DAX and act as a modifier or enhancer for calculation. It activates the inactive relation. But make sure you have an inactive relationship in place before using the use relationship function. Let's see how it works on Sample Superstore data. In my fact table I have two dates- Order date and Ship date. I am making the two relations between my date table and fact table. The relation between the sample superstore (date) to date table (date) is active while the relation between the sample superstore (ship date) to date table (date) is inactive