Forum Discussion
Auto-Reset Slicer Selection When Changing Selection in Main slycer
I have two attributes in my report: "Sales Groups" and "Sales Types," with a one-to-many relationship between them. Each "Sales Type" belongs to a single "Sales Group," while one "Sales Group" can have multiple "Sales Types." On the same report page, I use two single-select slicers—one for "Sales Groups" and one for "Sales Types."
The functionality works so that when I select a specific "Sales Group," only the corresponding "Sales Types" are shown in the second slicer. However, I'm encountering an issue: when I switch between different "Sales Groups," the "Sales Types" slicer remains stuck on the previously selected type from the first group.
What I'd like to achieve is for the "Sales Types" slicer to automatically select the first available option whenever I change the "Sales Group," instead of keeping the previous selection.
Can anyone help with a solution for this?
- Anonymous1 year ago
Hi margaridatedim ,
You can try formula like below:
FirstSalesType = CALCULATE( FIRSTNONBLANK('Sales Types'[Types], 1), FILTER( 'Sales Types', 'Sales Types'[Group] = SELECTEDVALUE('Sales Groups'[Group]) ) )SelectedSalesType = IF( ISFILTERED('Sales Types'[Types]), SELECTEDVALUE('Sales Types'[Types]), [FirstSalesType] )
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous1 year ago
Hi margaridatedim ,
Choose SelectedSalesType to Filters on this visual. You can check pbix file i have provided.
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- Kedar_Pande
Super User
Power BI doesn't automatically clear slicer selections between interactions by default.
You can use Clear all slicers to reset the slicers every time.
If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn - margaridatedimFrequent Visitor
Hello,
thank you for your response.
I don't want to clear the slicers. I want it to automatically change between selections when in the "main" slicer I change my selection. So for example, when I choose "Web" in Sales Groups I want it in Sales Types to choose "AliExpress" (first row in this category) and then I choose "Store" in the Sales Groups that it automatically change to "Alasca" in the Sales Types and it's not doing that it gets "stuck" in "AliExpress" eventhough this category doesn't even exist for the "Store" group so my dashboard is all blank.
- AnonymousNot applicable
Hi margaridatedim ,
You can try formula like below:
FirstSalesType = CALCULATE( FIRSTNONBLANK('Sales Types'[Types], 1), FILTER( 'Sales Types', 'Sales Types'[Group] = SELECTEDVALUE('Sales Groups'[Group]) ) )SelectedSalesType = IF( ISFILTERED('Sales Types'[Types]), SELECTEDVALUE('Sales Types'[Types]), [FirstSalesType] )
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- margaridatedimFrequent Visitor
May I ask where should I put what?
- AnonymousNot applicable
Hi margaridatedim ,
Choose SelectedSalesType to Filters on this visual. You can check pbix file i have provided.
Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.