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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LostintheBIu
Helper I
Helper I

Replicating "Test as role" Feature in Report using RLS Heirarchy

Hi everyone,

 

Short question:

Is it possible for end users to select a new USERPRINCIPLENAME through which the report is viewed, based on a selection (slicer?) of their subordinates? Esentially, can you replicate the "test as role" feature in the report itself using an RLS heirarchy?

 

Context:

I'm working on a report that gives managers information about their employees. I have dynamic RLS set up based on a PATH heirarchy, so managers are able to see data only about employees underneath them in the heirarchy. This works fine.

However, HR and leadership would also like to dynamically view the report from the perspective of a given manager or department head. Just like the "test as role" feature in the desktop or online. That way they can look at how individual teams or departments are performing. I would preferably like to create a separate report that is not dependent on RLS (so leadership can pick and choose departments with full access to data), but I have been asked to bake-in the feature into the current report.

 

Currently, the USERPRINCIPLENAME dictates whose data is visible based on a PATHCONTAINS search of line managers. Is there a DAX expression I could use to dynamically change the UPN based on a selection to override the current UPN? Is there a better way to do this? 

 

PATHCONTAINS('EmployeeData'[path],
MaxX(
Filter(
'EmployeeData',
[Username]=USERPRINCIPALNAME()
)
,'EmployeeData'[Employee.Line Manager]
)
)

Much thanks!

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

Perhaps create a separate page that does a FILTER based upon PATHCONTAINS based upon a slicer's value (pulled from a table of user names). RLS should prevent any other users other than those that can see ALL users.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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