Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors