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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

RLS Help - What method is best

Hi,

 

Creating a new thread as need more basic advice on what way is best to implement RLS for my scenario. The RLS Table would look like this:

 

EmailUserManagerAccountRegionCountryTransaction Type
User1@usermail.comUser 1User 1 EMEA  
User2@usermail.comUser 2User 1WordEMEAFrance 
User2@usermail.comUser 2User 1ExcelEMEAGermany 
User3@usermail.comUser 3User 3  United Kingdom 
User3@usermail.comUser 3User 3  Ireland 
User4@usermail.comUser 4User 3Outlook United Kingdom 
User4@usermail.comUser 4User 3Outlook Ireland 
User5@usermail.comUser 5User 5 EMEA Resell
User6@usermail.comUser 6User 5  GermanyResell

 

My Data has corresponding fields for Manager | Account | Region | Country | Transaction Type.

 

What I need is when a User logs into PowerBi they can only see the corresponding portions from above. If one of the fields is blank in the Rule table ie Account then I want no filter to apply at all to Account for that user. When there are multiples completed then I want each rule to be applied to the user.

 

So User2 should only see User 1's subset and Accounts Excel & Word Countries of France and Germany (Region EMEA).

 

So questions:

 

Should I split the above RLS table into 5 separate tables with the Email as the common index (repeated for users if say they cover 2 countries)

 

What is the best way of implementing rules like this?

 

I tried creating a rule for say Account then Country and put a user in both rules but in Desktop simulation of that user if both rules are on then NO rules applied at all.

 

Thanks for any and all advice.

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You could refer to the following DAX:

if(
USERPRINCIPALNAME()  in 
SELECTCOLUMNS('List',"A",List[Email])
,
'Table'[Region] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Region]),List[Email]=USERPRINCIPALNAME())
&&
'Table'[Account] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Account]),List[Email]=USERPRINCIPALNAME()),
TRUE()
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I prefer to use single table.

You could refer to the following DAX:

 

'Table'[Region] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Region]),List[Email]=USERPRINCIPALNAME())
&&
'Table'[Account] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Account]),List[Email]=USERPRINCIPALNAME())

 

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Thanks a million! and how do I account for scenarios where the field in the RLS table is blank? In those scenarios I want no filters applied to that field for the user?

Hi @Anonymous ,

 

You could refer to the following DAX:

if(
USERPRINCIPALNAME()  in 
SELECTCOLUMNS('List',"A",List[Email])
,
'Table'[Region] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Region]),List[Email]=USERPRINCIPALNAME())
&&
'Table'[Account] in 
CALCULATETABLE(SELECTCOLUMNS('List',"A",List[Account]),List[Email]=USERPRINCIPALNAME()),
TRUE()
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.