Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
1 year ago
Solved

How to automatically update a single-select slicer when the segme changes

How can I have Team Manager targeting automatically select the first available value each time the Regional Manager is changed?

  • Hi Syndicate_Admin  byyfghth 

     

    You can use the Pre-Selected slicer visual:

     

    It is a little fiddly to use so I reccomend to use the Download Sample button and have a play on theirs.

    You need to create a table using this script:

    _PreselectedSlicer = DATATABLE(
        "IsDirtySlicer1", BOOLEAN, "IsDirtySlicer2", BOOLEAN,
        {
            {FALSE(), FALSE()},
            {FALSE(), TRUE()},
            {TRUE(), FALSE()},
            {TRUE(), TRUE()}
        }
    )
     
    Then create a measure to define which item is the TOP:
    Top Town =
    var top1 =
    TOPN(1
    ,ALLSELECTED(Town) --table with items to tick
    ,[TownName] --calculation to sort using
    , DESC)
    RETURN
     SELECTEDVALUE(Town[TownName]) = MAXX(top1, [TownName])
     --If current row is equal to target item return TRUE
     
    Use these in the slicer like this:

     

     

    Hope this helps 🙂

4 Replies

  • Hi Syndicate_Admin  byyfghth 

     

    You can use the Pre-Selected slicer visual:

     

    It is a little fiddly to use so I reccomend to use the Download Sample button and have a play on theirs.

    You need to create a table using this script:

    _PreselectedSlicer = DATATABLE(
        "IsDirtySlicer1", BOOLEAN, "IsDirtySlicer2", BOOLEAN,
        {
            {FALSE(), FALSE()},
            {FALSE(), TRUE()},
            {TRUE(), FALSE()},
            {TRUE(), TRUE()}
        }
    )
     
    Then create a measure to define which item is the TOP:
    Top Town =
    var top1 =
    TOPN(1
    ,ALLSELECTED(Town) --table with items to tick
    ,[TownName] --calculation to sort using
    , DESC)
    RETURN
     SELECTEDVALUE(Town[TownName]) = MAXX(top1, [TownName])
     --If current row is equal to target item return TRUE
     
    Use these in the slicer like this:

     

     

    Hope this helps 🙂

  • v-sdhruv's avatar
    v-sdhruv
    Icon for Community Support rankCommunity Support

    Hi Syndicate_Admin ,
    Thanks for reaching out on Microsoft Fabric community forum.
    I hope you were able to resolve the issue by the solution provided.
    If you still need any help, feel free to reach out.

  • v-sdhruv's avatar
    v-sdhruv
    Icon for Community Support rankCommunity Support

    Hi Syndicate_Admin ,
    I hope your issue was addressed.
    If you were able to resolve the issue, pleas Acccept it as a solution or give Kudos so that other users can benefit from it.
    Thank You

  • v-sdhruv's avatar
    v-sdhruv
    Icon for Community Support rankCommunity Support

    Hi Syndicate_Admin ,
    I hope your issue was addressed.
    If you were able to resolve the issue, please Acccept it as a solution or give Kudos so that other users can benefit from it.
    Thank You