Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Cipriano
Helper III
Helper III

Show or Hide Navigation Buttons Based on Security Roles

Hello everyone.

I have a Power bi file, which contains 3 sheets:

1.- Navigation menu to Visualizations (with 2 buttons that direct to the Visualizations of role 1 and 2)

2.- Visualization for 1st Role

3.- Visualization for 2nd Role

Is it possible to Show or Hide the navigation buttons depending on the role that I enter to use this file? For example if I have the following users: User1, User2.

User1 would only see button 1 that directs to Sheet with visualization 1.

User2 would only see button 2 that directs to Sheet with visualization 2.

Any ideas? Thank you very much in advance!

3 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Consider using the Audiences feature, and different reports.

View solution in original post

FarhanJeelani
Super User
Super User

Hi @Cipriano 

Yes, this is possible in Power BI by leveraging row-level security (RLS) and dynamic button visibility. Here's how you can do it:

Steps to Show/Hide Navigation Buttons Based on Roles:

  1. Set Up Roles in Power BI:

    • Go to Modeling > Manage Roles.
    • Create roles like Role1 and Role2 based on your requirements.
    • For example:
      • Role1 is assigned to User1.
      • Role2 is assigned to User2.
  2. Create a Table for Role-Based Navigation:

    • Add a new table in Power BI, e.g., RoleNavigation, with the following structure:
      Role       ButtonVisible
      Role1      1
      Role2      2
    • Load this table into Power BI.
  3. Link the Roles to Users:

    • In the Manage Roles section, assign users to their respective roles.
  4. Create a Measure for Button Visibility: Use the RoleNavigation table to dynamically control button visibility:

    ButtonVisibility = 
    VAR CurrentRole = SELECTEDVALUE(RoleNavigation[Role])
    RETURN
        IF(
            CurrentRole = "Role1" && [Button] = "Button1", 1,
            IF(CurrentRole = "Role2" && [Button] = "Button2", 1, 0)
        )
  5. Apply Conditional Formatting to Buttons:

    • Select each button in your navigation menu.
    • Go to Format > Visual > Effects > Visibility.
    • Use the ButtonVisibility measure to toggle visibility:
      • Button1: Set ButtonVisibility for Role1.
      • Button2: Set ButtonVisibility for Role2.
  6. Test with View As Roles:

    • Use Modeling > View as Roles to simulate different users (Role1 or Role2).
    • Verify that each user sees only the appropriate button.

This approach ensures that:

  • User1 sees Button1, directing them to Visualization for Role 1.
  • User2 sees Button2, directing them to Visualization for Role 2.

Let me know if you need more details!

 

Please accept this as solution if it helps. Appreciate Kudos.

View solution in original post

Hi @Cipriano
@FarhanJeelani's definitely solution should work. You can further customize the button action to direct to a specific page or, alternatively, no action (via Destination setting) at all when user selects the button when user does not meet a specific criteria.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

6 REPLIES 6
FarhanJeelani
Super User
Super User

Hi @Cipriano 

Yes, this is possible in Power BI by leveraging row-level security (RLS) and dynamic button visibility. Here's how you can do it:

Steps to Show/Hide Navigation Buttons Based on Roles:

  1. Set Up Roles in Power BI:

    • Go to Modeling > Manage Roles.
    • Create roles like Role1 and Role2 based on your requirements.
    • For example:
      • Role1 is assigned to User1.
      • Role2 is assigned to User2.
  2. Create a Table for Role-Based Navigation:

    • Add a new table in Power BI, e.g., RoleNavigation, with the following structure:
      Role       ButtonVisible
      Role1      1
      Role2      2
    • Load this table into Power BI.
  3. Link the Roles to Users:

    • In the Manage Roles section, assign users to their respective roles.
  4. Create a Measure for Button Visibility: Use the RoleNavigation table to dynamically control button visibility:

    ButtonVisibility = 
    VAR CurrentRole = SELECTEDVALUE(RoleNavigation[Role])
    RETURN
        IF(
            CurrentRole = "Role1" && [Button] = "Button1", 1,
            IF(CurrentRole = "Role2" && [Button] = "Button2", 1, 0)
        )
  5. Apply Conditional Formatting to Buttons:

    • Select each button in your navigation menu.
    • Go to Format > Visual > Effects > Visibility.
    • Use the ButtonVisibility measure to toggle visibility:
      • Button1: Set ButtonVisibility for Role1.
      • Button2: Set ButtonVisibility for Role2.
  6. Test with View As Roles:

    • Use Modeling > View as Roles to simulate different users (Role1 or Role2).
    • Verify that each user sees only the appropriate button.

This approach ensures that:

  • User1 sees Button1, directing them to Visualization for Role 1.
  • User2 sees Button2, directing them to Visualization for Role 2.

Let me know if you need more details!

 

Please accept this as solution if it helps. Appreciate Kudos.

@FarhanJeelani  - I have a similar requirement and trying to make use of your solution, Can you please let me know how you are calling Button in your DAX. Do we have to create any table for this?

POSPOS_0-1747927042683.png

 

Select each button in your navigation menu.
Go to Format > Visual > Effects > Visibility.

 

Can you share a screenshot?  Not seeing that option.

 

lbendlin_0-1733172399528.png

 

Hello, thank you very much for the support.

With the visibility options of the button, it was possible to show it or not, depending on the user, but only the buttons are hidden, if the user passes the mouse where the hidden button is, I could click and go to where it directed .

Is it possible to use safety Bookmarks and roles?

Hi @Cipriano
@FarhanJeelani's definitely solution should work. You can further customize the button action to direct to a specific page or, alternatively, no action (via Destination setting) at all when user selects the button when user does not meet a specific criteria.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
lbendlin
Super User
Super User

Consider using the Audiences feature, and different reports.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.