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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
maurisilv
Regular Visitor

Filtering on Row Level Security

Hello,

 

I'm looking for an answer that may not exist....  

 

I have a table (call it attendance Table) that has two columns, the name of the orientation a person attended and the email of the person who attended the orientation. This list only contains people who completed an orientation, and does not show a name if a person has not completed an orientation. I've used the USERPRINCIPALNAME() function in Row Level Security so that end users can only see their own orientations. The goal is to show a table that lists all the orientations they have not attended.

 

I have a separate table (Orientation Table) that contains all of the orientations, ideally I would add a column with an IF statement that says something like "IF USERPRINCIPALNAME() exists in other table, mark true, else false" but unfortunately you can't use USERPRINCIPALNAME to make columns.

 

I've also tried to append the Attendance Table to the Orientation table. In this scenario I would have all orientations listed, and then if the orientation name did not repeat, I would show it on a Table Visual to note that the user had not attended. Unfortunately, when you append the table using RLS, everything gets appended, not just the thing that the role lets you see, thus all of the orientations repeat.

 

Orientation ||           E-mail                  ||      Times repeated

Admin         || "fake@email.com"        ||       2

Finance       || "fake@email.com"        ||       1

Clinical        || "fake@email.com"        ||       1

Admin         || "realuser@email.com"  ||       2

 

If you have any thoughts or guidance on how to tackle this, I would highly appreciate it.

 

Best,

Mauricio

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @maurisilv ,

>>"IF USERPRINCIPALNAME() exists in other table, mark true, else false" but unfortunately you can't use USERPRINCIPALNAME to make columns.

Current power bi not allow you to use them in calculated column/table, you can write measure with these functions to return tag.

BTW, I think you need to create a bridge table to link attendance table and orientation table and turn on 'apply security filter in both direction' to enable RLS filter effect on each table.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @maurisilv ,

>>"IF USERPRINCIPALNAME() exists in other table, mark true, else false" but unfortunately you can't use USERPRINCIPALNAME to make columns.

Current power bi not allow you to use them in calculated column/table, you can write measure with these functions to return tag.

BTW, I think you need to create a bridge table to link attendance table and orientation table and turn on 'apply security filter in both direction' to enable RLS filter effect on each table.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.