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
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
Super User
Super User

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.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.