Forum Discussion
gisa_sam
3 years agoFrequent Visitor
RLS - Multiple User Roles with no relationship
Hi, I have 2 tables, a department table and a user table. Department table is one of the dimensional table connected to the main fact table.While User table is completely different table with no ...
- Anonymous3 years ago
Hi gisa_sam
You can refer to the following dax
VAR _user_dep = CALCULATE ( MAX ( 'User Table'[User Dep] ), 'User Table'[User Email] = USERPRINCIPALNAME () ) RETURN SWITCH ( CALCULATE ( MAX ( 'User Table'[User Role] ), 'User Table'[User Email] = USERPRINCIPALNAME () ), "Dep_role", IF ( [Department] = _user_dep, TRUE (), FALSE () ), "Team_role", IF ( [Team] = _user_dep, TRUE (), FALSE () ), "Exec_role", IF ( [Department] IN { "dep1", "dep2" }, TRUE (), FALSE () ), "Acc_role", TRUE () )Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
gisa_sam
3 years agoFrequent Visitor
Thanks, this worked!