Forum Discussion
How to filter table based on logged in user?
Hello, I am working on a report with two tables, Incidents and Users. I am trying to filter the incidents table to only show incidents that are of the same department as the user logged in. The incidents table itself does not have a department field. I currently have a relationship between the requestor id on the incident table and the sys id on the user table. I looked into the RLS and was able to filter for incidents where the user logged in is the requestor. How can I set this up to filter for departments of the user logged in?
Your reference table needs to contain the email address and the department. Set the RLS on USERPRINCIPALNAME(). The department then needs to control the tables that are downstream in the data model.
2 Replies
- V-lianl-msft
Community Support
Hi wasonj1 ,
Please refer to these blogs to help you better understand how to set up RLS:
https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - lbendlin
Super User
Your reference table needs to contain the email address and the department. Set the RLS on USERPRINCIPALNAME(). The department then needs to control the tables that are downstream in the data model.