cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

RLS / Multiple Categories

Hi All,

 

Im trying to figure out this dynamic RLS problem that i have. I want a simple RLS User table to filter allowed content using USERPRINCIPLENAME(). 

 

Example: In the case of a@aaa.com user should be seeing data only related to the following criteria: 

Peru/Finland/BU1/BU2/EPC

 

RLS User Table

Oceans88_0-1593522618583.png

 

Data Table

Oceans88_1-1593522956035.png

 

Anyone has an idea of how to acomplish this? 

 

Thanks in advance for any possible help. 

Kr

 

6 REPLIES 6
Community Support
Community Support

Hi @Oceans88 

 

If there's relationship exited between RLS User Table and Data table and assuming the related column is A in RLS table, B in Data table, you should specify the related column in the DAX expression such as:

 

[B] = MAXX(filter(RLS User Table,[Email] = USERPRINCIPALNAME()),[A])

 

here's also other blogs could be your reference:

https://radacad.com/dynamic-row-level-security-with-manager-level-access-in-power-bi

https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi

https://radacad.com/dynamic-row-level-security-with-power-bi-made-simple

 

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

Hi v-diye-msft,

 

Thank you for the link. Greatly apreciated. I have it somewhat working at the moment but i have an issue. 

I have 3 diffrent filtering criteria Country/BU/ INL. At the moment each user needs to information for each one of the criterias for RLS to work. If its missing one of the criterias it will show no data for the person. 

 

Example:

User: A@aa.com

User table: Sweden/BU1/EPC

This is working fine.

 

User: A@aa.com

User table: Sweden/BU1/

Instead of seeing as above, he/she will see nothing because its missing the INL information (EPC)

 

 

I have one Role with some code in each of the filtering tables

 
 

image.png

 

How can i modify this code to allow it to filter if one of the users is missing one of the 3 requierd criteria ?

Maybe som how :

 

If(Users[2-BU]=Blank(), Ignore,

CONTAINS (
Users,
Users[Email],
USERPRINCIPALNAME(),
Users[2-BU],
[BU]
)
||
CONTAINS (
Users,
Users[Email],
USERPRINCIPALNAME(),
Users[4-Global],
"Admin")

 

What do you think? 

 

 

 

The model

Oceans88_0-1593682322115.png

 

Just bumping up to see if anyone has any comments on my previous post. 

 

Kind regards

No Ideas, If there is something unclear just let me know and will clarify as best as possible

Super User III
Super User III

Hi @Oceans88 ,

 

Chek if the following thread helps:

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dynamic-RLS/m-p/1180195

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi Pragati, Thanks for sharing the link. No, i have tried and i can not det it to work. I have seen this post before. Any more ideas on how to accomplish? 

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors