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
Anonymous
Not applicable

RLS Functionality

Hi Guys,

 

I need help with RLS.

 

I have multiple tables in my project and I have one user table and i want if a user logs in then he should only see the data based on his role. can someone help me with this?

 

Should i use the filter like username = username ()

 

What expression can I write for ID. 

 

Himanshu_13_0-1602489032479.png

 

 

Regards,

Himanshu 

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hi, @Anonymous 

Userprincipalname() refers to the email adress that the user is currently using. This means that the ID column must contain the user email for this to work. Furthermore, the users table needs to be connected by relationship to the tables that needs to be filtered. 

[ID] = userprincipalname()

 
You can try out the RLS roles in Power BI Service to simulate how the report looks when viewing as different users. 

You can find this functionality under "Security" in the dataset options of the published dataset. 


image.png

 

Br, 
J


Connect on LinkedIn

View solution in original post

2 REPLIES 2
tex628
Community Champion
Community Champion

Hi, @Anonymous 

Userprincipalname() refers to the email adress that the user is currently using. This means that the ID column must contain the user email for this to work. Furthermore, the users table needs to be connected by relationship to the tables that needs to be filtered. 

[ID] = userprincipalname()

 
You can try out the RLS roles in Power BI Service to simulate how the report looks when viewing as different users. 

You can find this functionality under "Security" in the dataset options of the published dataset. 


image.png

 

Br, 
J


Connect on LinkedIn

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.