cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oussmissa
New Member

Dynamic RLS based on two users tables

Hello everybody,

I'm trying to implement RLS by Country and Brand at the same time based on two security tables.
Users who are in the security table by brand and other users who are in the 2nd security table by country.
We can have users who have access to the country but not the brand and the reverse case. ie users who exist in the first table but not the second and the reverse case.
We can have users who exist in both tables at the same time.

I have of course a Geography dimension table which contains the country code and brand code. this dimension is linked to my Sales fact table

Please help me how I can create a role (by country and brand at the same time) that takes these scenarios into consideration.

 

Oussmissa_0-1632164813877.png

 

3 REPLIES 3
Oussmissa
New Member

Thank you for your response @Greg_Deckler.

I have tried this but by doing this, the RLS is only applied for the users that exist in the 2 tables at the same time.
for a user who exists in table 1 and not table 2 or vice versa, he sees nothing...

@Oussmissa Oh yeah, you are right about that, let me think... What if you had a single users table related to your two user tables within just the user names and you applied the RLS there? I'm thinking it might end up with the same thing but maybe not?


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

Greg_Deckler
Super User
Super User

@Oussmissa So you cannot create two rules like:

Table User 1: USERPRINCIPALNAME() = [Email]

Table User 2: USERPRINCIPALNAME() = [Email]

 

And the obvious relationships to Dimension Geography from both tables.


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Kudoed Authors