Forum Discussion

jo123456's avatar
jo123456
Helper I
1 year ago
Solved

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 hav...
  • AmiraBedh's avatar
    1 year ago

    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).

    Then create a measure :

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

     

    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.