Forum Discussion
Manage Roles: Restrict access by employee team
Hi all, hope you've all had a great weekend :)
My database consists of at alot of tables with all sorts of data regarding a company, the employees, the projects the employees are working on and more importantly: the teams each employee is on.
There's two independent things I want to test using Manage Roles:
1) A person can only view information related to him/herself
2) A person can only view information related to the team he/she is on
Table samples:
1. Employees
emp_id, name, team
2. Projects
project_id, customer_name, ...
I'm sure this is a simple dax forumla but I'm quite new to Power BI. Appreciate it if someone would point me in the right direction :)
Currently the only roles made are practically "all employees" and "employee by [country]".
So I'm hoping the second DAX formula can be as simple as saying that "all employees can see all tables limited by their team".
3 Replies
- v-xicai
Community Support
Hi Anonymous ,
>>There's two independent things I want to test using Manage Roles:
1) A person can only view information related to him/herself
2) A person can only view information related to the team he/she is on
>>So I'm hoping the second DAX formula can be as simple as saying that "all employees can see all tables limited by their team".
From your words, I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis?
If you need to set RLS, please see the link Power BI Desktop Dynamic security cheat sheet, which described the detailed steps. Maybe it doesn't work, there are some tips to let it work and test it efficiently. You can also refer to this case .
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank for your for respond. Perhaps I was a bit unclear in my original message, so I'll try to illustrate here:
Let's say the business is a consultancy agency. It has employees that can work on different projects. Each employee is assigned to a specific team.
Rob works on the Safety-team. This role is assigned to him in the Employees table. I want to make a RLS rule that says that Rob can only see data from the Project-table where team = "Safety". This means Rob will be able to see data about himself and about Mary who also works on Safety. But only Jess will be able to see any data about anything related to the Communications-team.
I hope that cleared things up.
- AnonymousNot applicable
I was hoping RLS would be as simple to create a role and specify the Project table and write the dax:
[Team] = "Value"