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
Anonymous
Not applicable

Many to Many Relationship - Row Level Security?

So I have two tables. A fact table with Territory ID's and then the Employee table has Empolyee ID's and Territory ID's.

 

The Employee table has a many to many relationship between Employee ID's and Territory ID's. So one employee ID will have multiple Territory ID's associated with it. Also, one Territory ID can have multiple employee ID's associated with it.

 

I was trying to think of a way to use this table to implement row level security on the fact table, but I am having trouble coming up with a way to do so. Lookupvalue would not work since there are multiple employee ID's for one territory ID. 

 

Is it possible to have row level security in this situation?

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

>>Is it possible to have row level security in this situation?

Many to many relationships not works on power bi.
For your scenario, you need to add a bridge table to link tables who has the multiple records.(modify 'many to many' relationship to 'many to one')
After these steps, you can enable RLS on this bridge table.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

>>Is it possible to have row level security in this situation?

Many to many relationships not works on power bi.
For your scenario, you need to add a bridge table to link tables who has the multiple records.(modify 'many to many' relationship to 'many to one')
After these steps, you can enable RLS on this bridge table.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hey @v-shex-msft , how can I apply RLS to the bridge table? I have a similar scenario where I have one customer and many issuers (the security table) and then I have a dimension for the issuers. I created a bridge table of distinct issuers and I created a relationship with the dimension and the security table (both way filtering on both tables). When I applied RLS to the user security table it doesn't work.

 

Could you please elaborate more how do you apply RLS on the bridge table?

Thanks a lot!

theschuss
Frequent Visitor

what is your grain of security - territory? Or would someone theoretically be secured to employees? 

If territory - I would make the security flow one way. If you have both, perhaps setup multiple roles and potentially create an interstitial table using a merge query with all combinations and secure through that? 

Anonymous
Not applicable

Not sure if I understand your question completely, but I believe the grain of security would be Employee ID. This employee ID would be tied with their email address so that when they view the report only the territories that are mapped to that emplyee ID would appear. 

Ok, if you have security filter set to be bidirectional or one way from user and you should be fine if relationships exist between the tables. The user id will restrict the user table which will in turn limit the territory table through the inner join type logic.

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.