Forum Discussion
Filtering data from multiple tables based on logged in user
Hello,
I am working on my second PowerBi dashboard. It has three tables, Incidents, User, and Users Departments (some users are assigned to multiple departments). Currently I have it setup to filter all incidents where the user logged in is the requested for user on the incident table. I want it to filter all incidents where the logged in user is in that department (from User table and User Departments table). So if I was a part of ITD department and HR department, when I log in it should show me all the ITD and HR incidents. Please see screenshot below, yellow fields are my relationships that I have set both as many-to-many.
4 Replies
- lbendlinSuper User
You cannot have a department field in the user table. But you need a department field in the Incidents table. No idea how you get that when your users can be assigned to multiple departments.
- wasonj1Frequent Visitor
Why can't there be a department field in the user table?
- lbendlinSuper User
Quote: "(some users are assigned to multiple departments)"
Dimension tables need to have unique key columns.
- wasonj1Frequent Visitor
Thanks for the response, that makes sense. On the user table we only have the primary department they are associated with so it is unique there. On the Users Department table we have a record for each department they are in.