Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Power BI communnity
I want to give some team leaders access to see the performance of employees in their team with Row level security.
I have a table with the following colums.
User = table name
Index = [number] an index column
Userid = [number] a uniq id for each user
teamid = [number] an id for the team the employee belongs to. multiple users can be in the same team
Leaderid = [text] a list of all the teams a user is the leader of. (Ex. 5,7,8,10)
Diffrent users can be the leader of the same team.
If a user is the leader of (5,7,8,10) he should be able to see all users with the team id IN {5,7,810}
What is the correct way to solve this with Row level security?
All help and feedback is greatly appreciated.
To implement Row-Level Security (RLS) in Power BI for team leaders to only see the performance of employees in their teams, you can follow these steps:
Create a Relationship:
Create a Role in Power BI:
Go to the "Model" view in Power BI Desktop.
Under the "Model" view, locate the "Manage Roles" option in the ribbon.
Click "Manage Roles" to open the "Model View" dialog.
Create a Role for Team Leaders:
Create a new role called "Team Leader" (or any name that makes sense to you).
Define a DAX expression that filters data based on the Leaderid column. This expression should allow users with the role to see only the data for the teams they lead.
Example DAX Expression:
PerformanceData[teamid] IN VALUES(User[teamid]) &&
ISNUMBER(FIND(User[Userid],[@Userid]))
In this example, [@Userid] refers to the user viewing the report. The expression checks if the teamid of the performance data matches any of the teamid values in the User table for which the user is the leader.
Assign Users to Roles:
Test RLS:
Publish to Power BI Service:
Configure Gateway (if needed):
Assign Roles in Power BI Service:
In the Power BI Service, navigate to the dataset settings, go to the "Security" tab, and assign users to the appropriate roles.
Add the users who are team leaders to the "Team Leader" role.
Test in Power BI Service:
This approach uses RLS to dynamically filter data based on the team leadership information. It allows each team leader to see only the data for the teams they are responsible for.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.