Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
528 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Cross-filtering slicers in Power BI |
---|
This blog shows you two ways to make your slicers apply filters to other slicers in a Power BI report. |
In this blog
Have you ever been annoyed that your Power BI slicers don't appear to interact with each other by default? Take the report below for example, which shows a list of films with slicers to filter by director and genre:
After selecting Akira Kurosawa from the Director slicer, I still have the option to select Awful films from the Genre slicer. Surely, this can't be right?!
This means that you can select combinations of options from multiple slicers which produce no results:
As I thought: Kurosawa didn't make a bad film in his career!
Wouldn't it be more intuitive if the Genre slicer was filtered based on the choice you make in the Director slicer?
The reason for the behaviour shown above is that the relationships in the data model only allow filters to propagate in a single direction by default. You can see this in the model view of your report:
The arrow on a relationship shows in which direction a filter can travel.
In the diagram above, the direction of the arrows show that a filter can flow from the Director table to the Film table, but not from the Film table to the Genre table. Currently, the filter applied by selecting a Director in the slicer has no way to reach the Genre table.
One way to solve the problem is to change the filter direction of a relationship to allow filters to flow in both directions. For our example to work, we need to allow filters to flow from the Film table to the Genre table.
To do this, click on the relationship whose direction you want to change, then change the Cross-filter direction option in the Properties window:
Set the Cross-filter direction to Both then click Apply changes.
After doing this, the arrow should indicate that filters can now flow in both directions:
The arrows show that filters can flow in both directions in this relationship.
Returning to the report view should show that the Director slicer now affects the Genre slicer:
Selecting a director now shows only the genres of films made by that director.
Problem solved! Or is it?
If changing the filter direction of a relationship to Both solves the problem so easily, it begs the question: why isn't it the default? The simple answer is that allowing filters to flow in both directions for every relationship in a complex data model can cause more significant problems than slicers not filtering each other!
If you're interested in the gory details of problems caused by bi-directional cross-filtering, try this article.
For the purposes of this blog, it's sufficient to know that allowing filters to flow in both directions can cause problems that are difficult to solve later.
If allowing bi-directional filtering is, in principle a bad idea, what other option do we have to make our slicers interact with each other? One option is to use a measure which allows us to filter out the genres which have no films by the selected director.
To create a measure, select the table you want to add the measure to and choose Home | New measure from the ribbon. You can enter the code below to create a measure which counts the rows of the Film table:
The COUNTROWS function counts the rows of the specified table.
To picture the results of this measure, you can place it into a table visual along with the Genre field:
Selecting a director shows how many films of each genre they directed.
Where a director has no films for a particular genre, the result of the measure is Blank.
We don't really want to display the results of the measure in a visual. Instead, we want to use it to apply a filter to a slicer.
To do this, select the slicer you want to filter, then drag the measure into the Filters on this visual part of the Filter pane.
We have selected the Genre slicer then dragged the Count of Films measure into the Filters on this visual area of the Filters pane.
You can then set the filter to show only items where the value of the measure is not blank:
Choose to show items when the value is not blank then click Apply filter.
You should now find that the slicers behave in the same way as though you had modified the filter direction of the relationships:
The Genre slicer now responds to selections made in the Director slicer.
You can use the same measure to apply a filter to the Director slicer so that it will respond to selections you make in the Genre slicer.
Some other pages relevant to the above blog include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.