I have a PowerBI report that uses RLS to make sure the respective users only see their respective companies information (sales etc)
The RLS is configured to the Users-table (DimUsers) as such: Email = Userprincipalname() DimUsers is related to DimCompany with a one-to-one relationship, and then DimCompany filters FactSales and the rest of the data model.
This works fine. But i need to add more users to view the same company. Hence i will need more emails in DimUsers connected to the same DimUsers, and so it does not work with a one-to-one relationship anymore, and the RLS does not function. It needs to work for these setup:
How can i fix this issue?
Thanks a lot in advance :)
CodePudding user response:
Your relationship should have "Cross filter direction" both and Apply security filter in both directions
CodePudding user response:
In general to make RLS simple, introduce a table with all the valid combinations, here (UserPrincipalName,CompanyId). Then put the RLS predicate on that table and have it flow filters to the DimCompany table.