Forum Discussion

tomperro's avatar
tomperro
Helper V
2 years ago
Solved

Pre-Select Slicer Based on User

Is there a way to pre-select slicers based on the logged in user?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi tomperro 

    You can use pre-slicer visual and rls, you can refer to the following example.

    Sample data 

    Goal: Based on the user to pick the biggest number in advance

    1.Create a user table.

    2.Add the pre-slicer visual to the desktop.

    3.Add a true/false table

    4.Create a relationship among the user table and the data table.

     

    5.Create a measure.

    Measure =
    VAR a =
        MAXX ( ALLSELECTED ( 'Table (2)' ), [Column2] )
    RETURN
        IF ( SELECTEDVALUE ( 'Table (2)'[Column2] ) = a, TRUE (), FALSE () )
    

    Then put the following field to the pre-slicer.

     

    6.Create a new role in RLS in user table.

    [useraccount]=USERPRINCIPALNAME ()

     

    7.Test the role.

    Best Regards!

    Yolo Zhu

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tomperro 

    You can use pre-slicer visual and rls, you can refer to the following example.

    Sample data 

    Goal: Based on the user to pick the biggest number in advance

    1.Create a user table.

    2.Add the pre-slicer visual to the desktop.

    3.Add a true/false table

    4.Create a relationship among the user table and the data table.

     

    5.Create a measure.

    Measure =
    VAR a =
        MAXX ( ALLSELECTED ( 'Table (2)' ), [Column2] )
    RETURN
        IF ( SELECTEDVALUE ( 'Table (2)'[Column2] ) = a, TRUE (), FALSE () )
    

    Then put the following field to the pre-slicer.

     

    6.Create a new role in RLS in user table.

    [useraccount]=USERPRINCIPALNAME ()

     

    7.Test the role.

    Best Regards!

    Yolo Zhu

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

     

  • Hi tomperro 
    There are a few options for the user to get filtered reports/dashboards according to their needs:
    1. He can create a personal bookmark for himself and keep the preferred selections. This is a closest one for your request
    More information here :
    https://www.youtube.com/watch?v=pHp4L2H7CGg

    2. To use Rls, but then the result is a filtered report without the option to change it.

    More information is here :
    https://www.youtube.com/watch?v=MxU_FYSSnYU

     

    3. To use the URL to the report, which can include filters that the user can change if he wants to.

    https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

     

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