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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ghouse_peer
Post Patron
Post Patron

RLS for names available in column

Hi Team

 

I need your help for below requirement.

I have 2 Columns

 

Leadership and Manager.

LeadershipManager
ABCEWQ
ABCERT
XYZJKL
CDELKJ
CDEOKM
QWELPO
TUVUNM
RFVKJH
MNBTGB

Leadership contains 7 Unique names of Leadership

Manager column contains 12 unique names of manager belonging to respective Leadership.

 

Now i need to provide RLS for respective leadership and managers. Whenever they login or access the report they need to see only there reports.

 

ex: if XYZ from leadership is accessing report then he need to see only his reports and his manger's report who is under him.

 

Kindly help with solution. Thanks in advance

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

Hi @ghouse_peer ,

 

Based on your description, this involves concepts related to dynamic RLS. You can do this with username and userprinciplename, but you need to be aware of their differences:
In Power BI Desktop, username() will return the user in DOMAIN\User format and userprincipalname() will return the user in user@contoso.com format.
In Power BI Services, both username() and userprincipalname() will return the user's User Principal Name (UPN). This looks similar to an e-mail address.


Refer to the following screenshot:

vkongfanfmsft_0-1704703270903.png

after publish to the service, test RLS

vkongfanfmsft_1-1704703353669.png

vkongfanfmsft_2-1704703405724.png

 

Also, you can refer to below document:

Row-level security (RLS) with Power BI - Power BI | Microsoft Learn

Dynamic Row Level Security with Power BI Made Simple - RADACAD

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-kongfanf-msft
Community Support
Community Support

Hi @ghouse_peer ,

 

Based on your description, this involves concepts related to dynamic RLS. You can do this with username and userprinciplename, but you need to be aware of their differences:
In Power BI Desktop, username() will return the user in DOMAIN\User format and userprincipalname() will return the user in user@contoso.com format.
In Power BI Services, both username() and userprincipalname() will return the user's User Principal Name (UPN). This looks similar to an e-mail address.


Refer to the following screenshot:

vkongfanfmsft_0-1704703270903.png

after publish to the service, test RLS

vkongfanfmsft_1-1704703353669.png

vkongfanfmsft_2-1704703405724.png

 

Also, you can refer to below document:

Row-level security (RLS) with Power BI - Power BI | Microsoft Learn

Dynamic Row Level Security with Power BI Made Simple - RADACAD

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ritaf1983
Super User
Super User

Hi @ghouse_peer 
Please refer to the linked tutorial

https://www.youtube.com/watch?v=c1P3W3xJl_4&t=2s

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.