Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

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:

 

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.

 

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

  • nandukrishnavs's avatar
    nandukrishnavs
    Community Champion

    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

     

    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!

     

    • Anonymous's avatar
      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.

       

       

      • nandukrishnavs's avatar
        nandukrishnavs
        Community Champion

        Anonymous Can you share your pbix file?

         

        Do you really require Level 1 in the visual?