Forum Discussion

ODK_jmor's avatar
ODK_jmor
Frequent Visitor
1 year ago
Solved

Slicer in Power bi with user list with out RLS

hi
i have th following problem

i have a table with all userid.

i want to create a slicer and set my userID = String "current user". all other userID is included in the slicer list
i want to open the report with default "Current User"

Any ideas?

John

  • Hey there!

     

    First you need to add a Calculated Column to Your User Table: 

    User_DisplayName =
    IF(
    'UserTable'[UserID] = USERPRINCIPALNAME(),
    "Current User",
    'UserTable'[UserID]
    )

    (This replaces the logged-in user's ID with "Current User". All other users remain unchanged.)

     

    Then use This Column in the Slicer

    - Add a slicer in Power BI.
    - Use [User_DisplayName] instead of [UserID].
    - Ensure that "Current User" appears as the default.

     

    And lastly, since Power BI does not allow direct slicer defaults, use Bookmarks:

    - Select "Current User" in the slicer.
    - Go to View → Bookmarks → Add a new bookmark.
    - Enable Data (so it saves slicer selection).
    - Set this bookmark as the default view when users open the report.

     

    Hope this helps!

    😁😁

2 Replies

  • freginier's avatar
    freginier
    Solution Sage

    Hey there!

     

    First you need to add a Calculated Column to Your User Table: 

    User_DisplayName =
    IF(
    'UserTable'[UserID] = USERPRINCIPALNAME(),
    "Current User",
    'UserTable'[UserID]
    )

    (This replaces the logged-in user's ID with "Current User". All other users remain unchanged.)

     

    Then use This Column in the Slicer

    - Add a slicer in Power BI.
    - Use [User_DisplayName] instead of [UserID].
    - Ensure that "Current User" appears as the default.

     

    And lastly, since Power BI does not allow direct slicer defaults, use Bookmarks:

    - Select "Current User" in the slicer.
    - Go to View → Bookmarks → Add a new bookmark.
    - Enable Data (so it saves slicer selection).
    - Set this bookmark as the default view when users open the report.

     

    Hope this helps!

    😁😁

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ODK_jmor ,

     

    Did @amitchandak reply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.

     

    Best regards,

    Adamk Kong