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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Huguo90
Helper I
Helper I

RLS with 4 tables

I want to do an RLS, but I have 4 tables I'm looking for a lookupvalue, to display a manager or a user. But I can't do it. I have trouble getting out of it. Here is what I did, but it doesn't work.


[ID]=
LOOKUPVALUE(
'Contact'[AccountId],
'The_users'[Email], UserPrincipalName(),
'Contact'[AccountId],
'Account'[ID])

Or I want to improve this but I can't

IF(
MAX(
FILTER('The_users_2','The_users'[Email]=USERPRINCIPALNAME()),
'The_users'[Distributor])=0,
'The_users'[Email]=USERPRINCIPALNAME(),
1=1)

how to add another condition in this formula, like: if Account'[ID]= The_users[AccountId], but it doesn't work.

The goal is to display both when what Users can see in addition to displaying their games that they can see in the RLS

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Huguo90 

 

Do you create any relationships between 4 tables? I would suggest that you create relationships between tables to pass the filtering rather than using LOOKUPVALUE. This would make it easier and faster. 

 

For example, create a relationship between 'Account' and 'The_users' tables on 'Account'[ID] and The_users[AccountId]. Note that if your DAX expression is performed on 'The_users' table, ensure that the relationship is Single (from 'The_users' to 'Account') or Both. The arrow direction on the relationship line represents the cross-filter direction between two tables. 

 

Similarly, create relationships between 'The_users' and 'Contact' tables or between 'Account' and 'Contact' tables. This is per your need. The purpose is to make one table filter another table through the relationship. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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