Forum Discussion

ANILKORLIMARLA's avatar
ANILKORLIMARLA
Frequent Visitor
2 years ago
Solved

Want to create a hierarchy based Metrics with user RLS

 We have a hierarchy CEO - SVP - VP - DIR - MGR (Need Metrics visual to show the sales)

1. when DIR log in to th report he need to see his and his down level employee data 

DIR  

    Mgr

2. when SVP log in to th report he need to see his and his down level employee data 

 

SVP

   VP

       DIR

          MGR

 

we need ro use the mectrics visual to show the numbers, please help me with the data modelling, like how to frame the data  

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ANILKORLIMARLA ,

    Please try below steps:

    1. below is the test table

    Table:

     

    Table(2):

     

    Model:

     

    2. add a new column in Table with below dax formula

    Path = PATH('Table'[Name],'Table'[Manager])

     

    ā€ƒ

    3. create a new role with below dax formula

    a =
    PATHCONTAINS (
        'Table'[Path],
        CALCULATE (
            MAX ( 'Table'[Name]),filter(all('Table'),[Email] = USERPRINCIPALNAME () )
        )
    )
    

    4. add a table visual with Table(2) fields

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ANILKORLIMARLA ,

    Please try below steps:

    1. below is the test table

    Table:

     

    Table(2):

     

    Model:

     

    2. add a new column in Table with below dax formula

    Path = PATH('Table'[Name],'Table'[Manager])

     

    ā€ƒ

    3. create a new role with below dax formula

    a =
    PATHCONTAINS (
        'Table'[Path],
        CALCULATE (
            MAX ( 'Table'[Name]),filter(all('Table'),[Email] = USERPRINCIPALNAME () )
        )
    )
    

    4. add a table visual with Table(2) fields

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.