Forum Discussion
Show or Hide Navigation Buttons Based on Security Roles
- 1 year ago
Consider using the Audiences feature, and different reports.
- 1 year ago
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:
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.
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.
- Add a new table in Power BI, e.g., RoleNavigation, with the following structure:
Link the Roles to Users:
- In the Manage Roles section, assign users to their respective roles.
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) )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.
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.
- 1 year ago
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.
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:
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.
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.
- Add a new table in Power BI, e.g., RoleNavigation, with the following structure:
Link the Roles to Users:
- In the Manage Roles section, assign users to their respective roles.
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) )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.
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?
- PierreL691 year agoHelper IV
Hi,
Please did you find the solution how to call the Button in the dax ?