Forum Discussion

LP280388's avatar
LP280388
Resolver II
4 years ago
Solved

Dax required for RLS to view direct reportees

Hi Team,

 

Please help me with the dax expression for fetching the employee and his direct reports throught RLS

I have table called "employee table" with below columns

empid, name, managerid, supervisorid, ismanager/supervisor?

the last column has 1 if an employee is manager /supervisor and gives 0 when he is not.

 

how do i implement RLS with this

  • Hi LP280388 ,

     

    You can use this dax to do the filter:

    [empid] in 
    CALCULATETABLE (
        VALUES ( 'table'[empid] ),
        FILTER ( 'table', [supervisorid] = USERNAME () && [ismanager/supervisor] = 0 )
    )

    Result:

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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

4 Replies

    • mvsk1987's avatar
      mvsk1987
      Frequent Visitor

      LP280388 did you get the solution . i have a similar issue too where a manager who might not be part of the employee column will be able to see his direct and indirect reportees data.

      please help

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Community Support

    Hi LP280388 ,

     

    You can use this dax to do the filter:

    [empid] in 
    CALCULATETABLE (
        VALUES ( 'table'[empid] ),
        FILTER ( 'table', [supervisorid] = USERNAME () && [ismanager/supervisor] = 0 )
    )

    Result:

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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

    • LP280388's avatar
      LP280388
      Resolver II

      v-chenwuz-msft Thank you very much for this. How can I alter this Dax to make sure that the Manager's Manager will be able to see his subordinate's subordinate?