Forum Discussion

POSPOS's avatar
POSPOS
Icon for Post Partisan rankPost Partisan
1 year ago
Solved

How to hide buttons based on user role

Hi All,

I have two roles in Power BI desktop. My requriment is that , from the image below, the toggle button and the Text should  be hidden for Role 1 and it should show for Role 2.


Roles:
Role 1:

Role 2: 

Can someone please suggest how this can be achieved?

Thank you

 

  • Hi POSPOS,
    Thank you for reaching out to the Microsoft Fabric Community Forum.

    I have reproduced your scenario in Power BI Desktop and I achieved the expected outcome based on your requirements:

    • When RLS_1 user clicks the "Continue" button → they are redirected to Page_Role1.
    • When RLS_2 user clicks the "Continue" button → they are redirected to Page_Role2.

    This was achieved using:

    • Row-Level Security (RLS) to identify the user role.
    • A DAX measure to determine the destination page dynamically.
    • A button with conditional navigation configured via the Action > Page Navigation > Field value option.

    For your reference, I’ve attached the .pbix file that demonstrates this setup end-to-end. You can open it in Power BI Desktop and test it using “View as Role” from the Modeling tab.

    If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

5 Replies

  • Hi POSPOS 

    You're asking whether a toggle button (like "Department") can be hidden for Role 1 and shown only for Role 2 using RLS.

    To clarify: Row-Level Security (RLS) only restricts the data that is visible to users – it does not control the visibility of visual elements like buttons, tabs, or bookmarks.

    If you want to show or hide visuals based on roles, you'll need to use DAX-based conditional formatting (like using a measure to control the visibility of a visual via a transparent shape) or manage it via separate report pages and bookmarks, possibly combined with a slicer value filtered by role-specific logic.

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

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

    Hi POSPOS,
    Thank you for reaching out to the Microsoft Fabric Community Forum.

    I have reproduced your scenario in Power BI Desktop and I achieved the expected outcome based on your requirements:

    • When RLS_1 user clicks the "Continue" button → they are redirected to Page_Role1.
    • When RLS_2 user clicks the "Continue" button → they are redirected to Page_Role2.

    This was achieved using:

    • Row-Level Security (RLS) to identify the user role.
    • A DAX measure to determine the destination page dynamically.
    • A button with conditional navigation configured via the Action > Page Navigation > Field value option.

    For your reference, I’ve attached the .pbix file that demonstrates this setup end-to-end. You can open it in Power BI Desktop and test it using “View as Role” from the Modeling tab.

    If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.

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

      Hi POSPOS,
      I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
      Thank you.

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

    Hi POSPOS,
    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank you.

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

    Hi POSPOS,

    May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.