Have you ever come across a requirement where you need to pre-set some filters on your report to give the users a default view to the report? If yes, then this blog is the right place for you. In this blog, I will be sharing 2 ways on how we can achieve this requirement.
Let us start with the following visualisation:
It is a simple visual showing sales overtime. On the top there are 2 filters: Year and Category.
Now let us give this visual a default view to show only 2 years’ worth of data, i.e., from 2014 to 2016 and only display sales for JACKETS clothing category. We will get the following: (I have highlighted the filter selections for the chart)
From here onwards, we will look at the 2 ways where we can default these filters on the report.
Reset to Default Option in Power BI Service
Save the report with the filter selections shown in the previous step and publish it in workspace. When I publish it in the Power BI Service Workspace, I see that my filters are pre-set as I wanted them to be:
Now users can interact with the report and change the filters as they like but also, they can RESET the FILTERS to DEFAULT using the button provided in Power BI Service:
So, this is basically one of the ways we can use to pre-set filters for the users and then the users can further set it to default state. But this approach can be hard for the users who are not used to using a interface in this fashion. To make this easier for the users, we have a 2nd approach to achieve this.
Button to Reset Filters in Power BI
Let us start by creating a button in Power BI:
After playing around with some formatting options for the Button we added above, we get the following: (modify it as per your requirement)
Now the next thing is we need to create an action for this button that we created. Before creating an action, we will create a bookmark and save a state for the bookmark. Make sure to have the default filters right on the tab before updating the bookmark. In the below quick video, it is shown how you create a bookmark and then how you update its state.
After the state of the bookmark is updated with the relevant filters on the tab, we assign this bookmark as an action to the Button that we created:
Finally, your button is ready to be used. Just save your report and publish it again to Power BI Service. You can see in the below video, how button has given a better usability to the users to reset to the default state of the report.
The above approach clearly gives a better way from user point of view to reset the filters to the default state.
So, in this blog we looked at two different ways of defaulting the filter selections on the report in Power BI. Button approach seems to be more user friendly.