Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
jo123456
Helper I
Helper I

Dynamic Slicer

Hello,

 

I'm looking for an approach comparative to Tableau for dynamic slicer selection. 

 

Simplified: I have a slicer one with the following selections"Vegetables", "Fruits" & "Nuts"

 

I have a second slicer with apple, grapes, watermelon, orange, broccolli, cauliflower, peanuts, almonds & cashews. 

 

In tableau if a user selects Vegetables, it automatically picks up the first value alphabetically cauliflower,

if user selects fruits,  it automatically selects the first value of apples. 

 

Is there a way to force a similar behavior in Power BI, what I have now is if user selects vegetables then I select cauliflower then if user selects fruits then I need to deselect cauliflower to select a fruit for it to work.  Thank you

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

Power BI does not have the built-in ability to automatically deselect previous slicer selections as Tableau does, so manual deselection will still be necessary in the second slicer unless you use visuals and dynamic measures to display the output based on user selection.

You can create a mpping table that links the categories with the default item you'd like to select from the second slicer and and create a relationship between the first slicer’s table (Category) and the mapping table (Category).

AmiraBedh_0-1729287719532.png

Then create a measure :

SelectedItem = 
VAR SelectedCategory = SELECTEDVALUE(CategoryTable[Category])
RETURN
CALCULATE(
    FIRSTNONBLANK(MappingTable[Default Item], 1),
    MappingTable[Category] = SelectedCategory
)

 

AmiraBedh_1-1729287832288.png

While this doesn't "force" the second slicer to automatically select items, it dynamically updates a visual with the first item corresponding to the category selection. Users can then interact with the second slicer as needed for finer control.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

4 REPLIES 4
Kedar_Pande
Super User
Super User

divyed
Super User
Super User

Hello @jo123456 ,

 

There is no direct method but we can do some trick like below :

 

1. Considering you have 2 tables , one for items with values like apple, grape,broccoli etc and another for item category with values like Fruits, Vegitables and Nuts

2. Add a custom column Category in first table "Items" with below dax 

    

Category =
SWITCH(
    TRUE(),
    'Items'[Item] IN {"apple", "grapes", "watermelon", "orange"}, "Fruits",
    'Items'[Item] IN {"broccoli", "cauliflower"}, "Vegetables",
    'Items'[Item] IN {"peanuts", "almonds", "cashews"}, "Nuts",
    BLANK()
)
 
3. Create a measure called first_Selection using below dax, this will give first item for each category :
 //Measure to Pick the First Value Alphabetically
First_Selection =
VAR _Selection=
CALCULATE(
    MIN(Items[Item]),  // Returns the first alphabetical value
    FILTER(
        Items,
        Items[Category] = SELECTEDVALUE(Category[Item_Category])  // Filter by selected category
    )
)
RETURN
IF( ISFILTERED(Category[Item_Category]) =TRUE(),_Selection,"Please Select Item Category")
 
4. Create a slicer for item_Category and add Item_catagory as values
5. Add a table => First_Selection as value and do some formatting to remove borders,headers etc
6. Make sure you have valid relationship on table items and Item_Category if you have used both the tables
7. try clicking slicers, it will show a single value in the table which can be used as another slicer to filter other visuals as per need.
 
It will look like below
 
divyed_0-1729343842718.png

 

 

divyed_1-1729343865317.png

 

Power BI doesn't natively allow for slicer values to be automatically selected. However, with this measure (First Selection), you can display the default first value in a card or other visual, and guide users accordingly.

Alternatively, you can set up custom bookmarks and sync slicers to automatically reset them when certain conditions are met (like changing the first slicer), though this is more of a manual process than an automatic selection based on a DAX formula.

 

You can do formatting as per need. I hope this helps.

 

Did I answer your query ? If Yes , please mark this as solution.

 

Cheera

 
LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
Ritaf1983
Super User
Super User

Hi @jo123456 
These capabilities are available with the new and new list slicers

Ritaf1983_0-1729319081118.png

Ritaf1983_1-1729319117278.png

pbix with the example is attached

more information about these slicers in the linked guides :

https://www.youtube.com/watch?v=V8etUojIQmw

https://www.youtube.com/watch?v=mSn08LiATGo

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
AmiraBedh
Super User
Super User

Power BI does not have the built-in ability to automatically deselect previous slicer selections as Tableau does, so manual deselection will still be necessary in the second slicer unless you use visuals and dynamic measures to display the output based on user selection.

You can create a mpping table that links the categories with the default item you'd like to select from the second slicer and and create a relationship between the first slicer’s table (Category) and the mapping table (Category).

AmiraBedh_0-1729287719532.png

Then create a measure :

SelectedItem = 
VAR SelectedCategory = SELECTEDVALUE(CategoryTable[Category])
RETURN
CALCULATE(
    FIRSTNONBLANK(MappingTable[Default Item], 1),
    MappingTable[Category] = SelectedCategory
)

 

AmiraBedh_1-1729287832288.png

While this doesn't "force" the second slicer to automatically select items, it dynamically updates a visual with the first item corresponding to the category selection. Users can then interact with the second slicer as needed for finer control.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors