Forum Discussion

想要多多的赚钱's avatar
想要多多的赚钱
Frequent Visitor
4 months ago
Solved

Slicer default selection

I want to implement the effect on the page There are two slicers on the page now, and the fields in these two slicers have hierarchical relationships. The slicers I use are button slicers. For examp...
  • InsightsByV's avatar
    4 months ago

    Hi 想要多多的赚钱 ,

    I have tried replicating your scnario and this behavior isn’t achievable through slicers alone, but you can implement it effectively using bookmarks.

     

    Here’s how you can set it up:

    Step 1:
    Go to Edit Interactions and ensure the Level 1 button slicer is not being filtered by the Level 2 slicer (disable the interaction if needed).

     

    Step 2:
    Select Type1 in Level 1 and ensure the corresponding default (e.g., Type_A) is selected in Level 2.
    Create a bookmark (e.g., Type1_Default) with the current state.

     

    Step 3:
    Select Type2 in Level 1 and set the Level 2 slicer to the desired default (e.g., Type_E).
    Create another bookmark (e.g., Type2_Default).

     

    Step 4:
    Assign these bookmarks to buttons (or your existing button slicers) so that:

    • Clicking Type1 triggers Type1_Default
    • Clicking Type2 triggers Type2_Default

    This approach allows you to simulate dynamic default selections for Level 2 based on Level 1.

     

    I am unable to attach my pbix file here for this solution - not able to see any option to attach my file.

    Hope above answers will help though!

     

    Please mark this answer as accepted if it resolves your issue. Kudos are appreciated! 🙂

  • SamInogic's avatar
    4 months ago

    Hi,

     

    As per our understanding, what you’re trying to achieve (dynamic default selection in a dependent slicer based on another slicer) is not supported out-of-the-box in Microsoft Power BI.

    Why it’s not working

    Power BI slicers are user-driven filters, not programmable controls. So:

    • When you select Type2 in Level 1, Power BI filters Level 2 correctly (shows Type_E, Type_F, Type_G)
    • But it cannot automatically select a default value (Type_E) within that filtered list

    There is no native feature to force a slicer to auto-select a value based on another slicer.

    Workarounds (Best Practices)

    1. Use a Measure-Based Default Logic (Recommended)

    Create a measure that simulates default behavior when nothing is selected:

    Selected Level2 =
    VAR SelectedL1 = SELECTEDVALUE(Table[Level 1])
    VAR SelectedL2 = SELECTEDVALUE(Table[Level 2])
    RETURN
    IF(
        ISBLANK(SelectedL2),
        SWITCH(
            SelectedL1,
            "Type1", "Type_A",
            "Type2", "Type_E",
            BLANK()
        ),
        SelectedL2
    )

    Use this measure in visuals instead of directly relying on slicer selection.

     

    2. Sync Slicers + Bookmarks Trick

    You can create a pseudo-default behavior:

    • Create bookmarks for:
      • Type1 → Type_A selected
      • Type2 → Type_E selected
    • Add buttons or logic to switch bookmarks

    Limitation: This is manual UX control, not dynamic logic.

     

    3. Pre-filter Using a Flag Column

    Add a column like:

    DefaultFlag =
    IF(
        (Table[Level 1] = "Type1" && Table[Level 2] = "Type_A") ||
        (Table[Level 1] = "Type2" && Table[Level 2] = "Type_E"),
        1,
        0
    )

    Then:

    • Use this in filters or visuals to highlight/select defaults

    Note :

    If you're expecting behavior like:

    “When I click Type2 → automatically select Type_E”

    That’s not how Power BI slicers are designed. They don’t support:

    • Conditional default selections
    • Programmatic selection changes

    Hope this helps.

     

    Thanks!

     

  • cengizhanarslan's avatar
    4 months ago

    Step 1) Set up the first bookmark

    Select Type1 in the Level 1 slicer and select Type_A in the Level 2 slicer. Go to View → Bookmarks → Add and name it "Type1 Default".

     

    Step 2) Set up the second bookmark

    Select Type2 in the Level 1 slicer and select Type_E in the Level 2 slicer. Add another bookmark and name it "Type2 Default".

    For both bookmarks make sure Data is checked and Display is unchecked in the bookmark options so only the slicer state is captured, not visual visibility.

     

    Step 3) Use bookmark navigator

    Instead of using a slicer visual for "Level 1" use a bookmark navigator that would help you to seleck each bookmark you have created.

  • SamInogic's avatar
    SamInogic
    4 months ago

    Hi,

     

    Glad to know you found our solution helpful.

     

    If this helped you, can you please mark our solution as accepted so that next time if someone else face same situation as yours then they can find our solution helpful too

     

    Thanks!

  • v-aatheeque's avatar
    v-aatheeque
    4 months ago

    Hi 想要多多的赚钱 

    Glad to hear your issue is resolved!
    If any of the responses helped, please consider marking it as a solution so it can benefit others facing a similar issue.
    Feel free to reach out if you need anything further.