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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Lopez0090
Helper III
Helper III

Obtain all affiliated departments with a hierarchical RLS

There is a table called "Emp_Info", and currently, the RLS DAX is being created using the following formula.

img1.png

PATHCONTAINS(Emp_Info[Path],
MAXX(
FILTER(Emp_Info,
[Email] = USERPRINCIPALNAME()),
Emp_Info[EmpID]
)
)

 

When testing with the user "AAAAA@.com" with EmpID "123" in the above DAX, the result is as follows.

The situation is such that rows with the Path containing one's own EmpID are being retrieved.

img2.png

 

However, what we want is the following result. For users with EmpID "123", they should be able to retrieve all information for their own department "Tokyo", and also retrieve all information for departments (Sydney and Paris) where their subordinates with EmpID "456/678/897" are located.

The diagram would look like this.

img3.png

 

If we were to test with the user "HHHHH@.com" with EmpID "887", we would want the following result.

For users with EmpID "887", they should be able to retrieve all information for their own "Sydney" sales department.

img4.png

 

Could you please advise on how to create a Row-Level Security DAX that displays the desired results based on the current DAX?

 

 

Best regards,

Lopez

0 REPLIES 0

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.