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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors