Forum Discussion

Truelearner's avatar
Truelearner
Icon for Helper III rankHelper III
6 years ago
Solved

rls problem

PATHCONTAINS(Emp[epath],MAXX(FILTER(Emp,Emp[email] = USERPRINCIPALNAME()),Emp[id]))     above role is not working    id       name          email                               manager epath ...
  • v-yingjl's avatar
    6 years ago

    Hi Truelearner ,

    In Manage roles, you can create roles and try this DAX expression to solve your problem:

    IF (
        CALCULATE (
            COUNTROWS ( 'Emp' ),
            FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
        ) > 0,
        [id]
            = CALCULATE (
                MAX ( 'Emp'[id] ),
                FILTER ( 'Emp', 'Emp'[email] = USERPRINCIPALNAME () )
            ),
        [email] = USERPRINCIPALNAME ()
    )

    When you use View as roles, you will get the following result:

    Here is the demo, please try it:

    PBIX 

     

    Best Regards,

    Yingjie Li

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.