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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

How to deal with this RLS scenario?

Here is the RLS scenario I am trying to find a solution for.  

 

In our opportunities table, we have both the Account owner, and the Opportunity owner.    The account owner is not always the same as the opportunity owner...and vice versa.    Our management wants the salesperson to see their opportunities (and only theirs) if they are the account owner and/or the opportunity owner.     So in the example below, Jane Smith should see Opportunities  a, b, and d.  

 

The challenge is that User IDs in our master employee table filters the Accounts table, (one user to many accounts), which in turn filters the Opportunities table (one account to many opps).  So in my current setup, the RLS will only show users the opportunities that they are the Account owner of, since the Accounts table is filtering the Opps table.   

 

In essence what I need is that if the userprinciplename = current user, and if that current user's USER ID matches either the account owner id OR the opp owner id, then show those records.   Just not sure how to implement this.  

 

Account Owner    Opp Owner     Opportunity

Jane Smith            Jane Smith         a

Ted Jones              Jane Smith         b

Jack Torres            Jack Torres         c

Jane Smith            Ted Jones          d

Ted Jones              Jack Torres        e

 

2 REPLIES 2
Anonymous
Not applicable

@otravers  Interesting idea.   Another approach I was thinking was to (in query editor) say:  If account owner = opportunity owner, then true/false.    Then apply RLS agains that column where the current user  (user principal name) would see only the True values.   Just need to figure out how to set that up in DAX or in the modeling view.  

otravers
Community Champion
Community Champion

There are probably different ways to approach this. One option would be to unpivot the Account Owner and Opp Owner columns into two columns: Owner and an Owner Type, then apply RLS against the Owner column.

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.