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
bcobrien1977
Helper IV
Helper IV

Dynamic Row Level Security with multiple factors

Hi, 

I have several contracts where I only want the data to be seen for employees in that contract and some employees do work on multiple contracts. 

bcobrien1977_0-1683632319502.png

Here is an example with all of the data. I want contract A to be selected and the only the A contract to be displayed.  

 

 

bcobrien1977_1-1683632541653.png

[Contract] = LOOKUPVALUE(Contract[Contract],Contract[Contractor Email],USERPRINCIPALNAME())

 

Here is what I am using to do the RLS but I cannot get this to work with an employee that works in multiple contracts.  Can anyone please assist?  Thanks

3 REPLIES 3
v-xinruzhu-msft
Community Support
Community Support

Hi @bcobrien1977 

You can create a new  table and input the useremail and the contract you want to the user to watch.

e.g 

vxinruzhumsft_0-1683769628854.png

 

Then create a one-to-many relationship between two tables.

vxinruzhumsft_1-1683769681210.png

 

Then create a rls 

vxinruzhumsft_2-1683769698743.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for doing this. When I try to test this, using Contract, it does not filter this.

I see you have email adresses input that don't reconcile to the users I provided. 

Can you please explain a bit more how this works?

 

Again, Contract A employees would see onliy contract A, b would see B and so on.

Thanks

 

Hi @bcobrien1977 

What I provided is only test data, you need to modify the email address to the corresponding user's email (this email needs to be the email corresponding to userprincipalname).

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.