Home > Software design >  Role level security with multiple users to filter on same IDs
Role level security with multiple users to filter on same IDs

Time:09-22

I have a PowerBI report that uses RLS to make sure the respective users only see their respective companies information (sales etc) This works

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: I need this to work

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

enter image description here

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.

  • Related