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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to create dynamic path for role level security.

Hi All,

 

I have a requirement where i have to create role level security as per organization structure. I tried doing this using PATH function. However, got stuck in below scenario:

 

nisha_0-1626070390492.png

In case when Amy login he should only see the data for himself and Lindsay, But in my current development I am getting below output.

 

nisha_1-1626070511420.png

It should not show Reza Rad.

 

I am gusseing this is happening because in the PATH column, it generated 1|5|8, How can I create such path which is dynamic. i.e.

if Amy logs in he should get data only for those which are below not for above one.

 

Kindly help.

 

7 REPLIES 7
nandukrishnavs
Super User
Super User

@Anonymous 

 

Try the below logic in the RLS.

VAR _email = USERPRINCIPALNAME()
VAR _id = CALCULATE(SELECTEDVALUE('Table'[ID] ),FILTER('Table',[Email]=_email))
VAR _resultFilter =  PATHCONTAINS([Path],_id)
return _resultFilter

nandukrishnavs_0-1626078773147.png

 

Please find the attached pbix file.




Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

 


Regards,
Nandu Krishna

Anonymous
Not applicable

@nandukrishnavs  Thanks for you response. However, the solution which you provided is the same which I already have. My issue is If Amy logs in Reza Rad should not appear.

 

nisha_0-1626080899692.png

 

@Anonymous Can you share your pbix file?

 

Do you really require Level 1 in the visual?


Regards,
Nandu Krishna

Anonymous
Not applicable

@nandukrishnavs Yes require the level because needs to create matrix in the dashboard. 

@Anonymous Can you generalize the logic? Why can't you use Level 2 and Level 3? Then you will not see "Reza Rad" right? Suppose if Reza Rad login what should be the results? If you could provide more examples, we can try.


Regards,
Nandu Krishna

Anonymous
Not applicable

How to attach pbix file. Unable to find the icon.

Anonymous
Not applicable

Hi,

 

Looks like I dont have permission to attached pbix file. However, my requirement is, I have to create a matrix which will have all the levels. For example. In my case I have 3 level. Now issue is whenever Reza and Leila login they will see correct data. However, when Others logins, they will get Level 1 value as well. For example: If Bill login he will see Leila and Mark as well. I dont want to show higher level data. It should filter out.

nisha_0-1626155999375.png

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.