Forum Discussion
AnaMariaDe
1 year agoRegular Visitor
Change or switch slicer selection based on another slicer?
Hi all, I would like to ask for your help or some suggestions to manage a situation. Let me explain better: I have two filters, area and project. The area is a dropdown filter with multiple sel...
FarhanJeelani
Super User
1 year agoHi AnaMariaDe ,To achieve dynamic slicer behavior in Power BI where the selection in one slicer (Area) influences another slicer (Project), you can use the following approaches:
Option 1: Sync Slicers with Filters and Relationships
-
Create a relationship:
- Ensure the Area and Project fields are connected through proper relationships in your data model.
- For example, if Area and Project are from different tables, create a relationship between them in the model view.
-
Apply cross-filtering:
- Set the cross-filter direction to “Both” in the relationship settings if needed.
This ensures that selections in the Area slicer automatically filter the available options in the Project slicer.
Option 2: Use Measures and Conditional Filtering
If direct relationships don't work due to model complexity or other constraints:
Use a DAX measure to dynamically filter the Project slicer based on the Area slicer selection.
Example:
FilteredProjects =
CALCULATE(
DISTINCT('Project'[ProjectName]),
FILTER('Table', 'Table'[Area] IN VALUES('Area'[Area]))
)
Add the measure to your visual or slicer:
Replace the default Project slicer field with this calculated measure.
Option 3: Use "Sync Slicers" and Bookmarks
If you need greater control:
- Use bookmarks to save specific slicer selections.
- Sync slicers across pages, ensuring the Area slicer determines the Project slicer’s scope.
- Create a workflow: Use a combination of hidden visuals or buttons to mimic the behavior.
Please note:
If Area allows multiple selections, you might need to define rules for handling overlapping or cumulative Project selections.
Test the impact on performance if the model is large, as dynamic calculations can slow down visuals.
Please mark this as solution if it helps you. Appreciate Kudos.