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
thampton
Helper III
Helper III

RLS with username/email

Hello - i have an issue with RLS. First time using it, so might be a simple fix. I have a few tables in the model ALL which include a column that has an email address. (When i publish to PBI service, this username will match the email address in the table). When i create a role and filter all the tables to Email address column = Username(), no filtering happens.

 

Ideas?

1 ACCEPTED SOLUTION

Are you assigning users emails to the roles in the security option of datasets in the service?

View solution in original post

7 REPLIES 7
apo1979
Frequent Visitor

The Row-level security (RLS) rule with Power BI only worked in my case when in Workspace I define that users have only Viewer access.

jcarville
Skilled Sharer
Skilled Sharer

@thamptontry using USERPRINCIPALNAME() instead of USERNAME()

I tried this and it still did not filter anything.

 

I created a measure just to test, showing (user=userprincipalname) and this does show the correct email address (which matches what it in all the email columns) when published to power BI service.

Are you assigning users emails to the roles in the security option of datasets in the service?

This did it for me, but to me, is totally redunant. The whole reason I defined a dynamic role "[UPN] = USERPRINCIPLENAME()" was to not have to enter 'hard names' and now it turns out this only works when I add (quite the list) into the security options of the dataset service. Then I might as well hardcode the names directly into the data cube "[UPN] = johndoe@domain.com", etc. 

This did help! I did not know you had to add them on the service as well. It worked for 2/3 users i am testing with. For some reason the one is added on service, and the email matches what is on the table, but no filter is applied.

 

Thanks for the help so far!

No worries, I was recently looking at RLS myself for the first time and it involved a bit of trial and error. Glad I could be of some assistance.

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.

Top Solution Authors