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
JosephDodd
Frequent Visitor

RLS on Multiple Tables not behaving additive.

Using the star method, our FACT table is revenue based. We are adding a DIM table of Opportunities from SFDC. Some have associated revenue, but most do not.

 

The expected result is to have a user log in, see all revenue for all accounts (regardless of whether they have an associated opportunity), and see all Opportunities (regardless of existance of associated revenue). Additionally they should be able to see revenue that is associated with opportunities. 

 

The issue is that when we add our RLS rule for our SFDC Opportunity table, it restricts user visibility to only sales that are related to an Opportunity. 

 

Here is our 1st RLS:

LOOKUPVALUE ( 'SECURITY SALESREP'[Security Salesrep], 'SECURITY SALESREP'[User Id], USERPRINCIPALNAME (), 'SECURITY SALESREP'[Security Salesrep], 'SALESREP'[Salesrep Number]

It's using whatever is on the SECURITY SALESREP table by User ID and giving access to corresponding records on SALESREP which in turn is filtering the SALES table. This works.

 

Additionally the relationship between the SALES table and the SFDC Opp table is many to many and one directional. This ensures that the end user will be able to see records on SFDC Opp that do not have any records on the SALES table. However, this gives individuals access to ALL records on SFDC Opp, when we only want them to see their own records.

 

Here's our 2nd RLS that breaks everything. After this is added to the same RLS Role on the SFDC Opportunity table, it completely restricts the users visibility to only sales that have related SFDC Opportunities.

 LOOKUPVALUE ( 'SECURITY SALESREP'[Security Salesrep], 'SECURITY SALESREP'[User Id], USERPRINCIPALNAME (), 'SECURITY SALESREP'[Security Salesrep], 'SFDC Opportunity'[RepNumber] )

Again, the intention is to restrict the user's access to just their own Opportunities while maintaining the users visibility to all sales and all their own opportunities regardless of sales.  

Shouldn't the 2 RLS rules on 2 tables on the same role, be addative, rather than reductive?

JosephDodd_0-1696521936862.png

 

4 REPLIES 4
parry2k
Super User
Super User

@JosephDodd quick question, why do you have cross filter direction set to both between the sales person and combined table?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I use columns from the SALESREP table as display values and slicers, and they need to be able to take filters from other tables in the model (Through the SALES table) to remove non-relevant values.

parry2k
Super User
Super User

@JosephDodd if you check official documentation, it is additive:

 

Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I understand that the documentation says it is additive. However the combination of the two RLS rules are acting reductively in my model, not additively.

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.