Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Using RLS employee should see data for his organizational group as well as all his reportees data

Below is the Employee table showing Emp id , emp name email,Organization group, manager id , name and email. Each employee is assigned to more than one group (here 2 groups). Another is the sa...
  • Chakravarthy's avatar
    2 years ago

    Hi Anonymous 

    This should be model

    This should be Joins between tables:

    Table DAX Code:

    1. DISTINCT_EMP = DISTINCT(Employee[Employee Email])
    2. BRIDGE =
    VAR TABLE1 =
                SUMMARIZECOLUMNS(
                    Employee[Employee Email],
                    Employee[Manager Email]
                )

    VAR TABLE2 =
                SUMMARIZE(
                    Employee,
                    Employee[Employee Email],
                    "Manager Email", Employee[Employee Email]
                )

    RETURN
    UNION
    (
        TABLE1,
        TABLE2
    )
     
    3. BRIDGE1 = DISTINCT_EMP
    Please check this "Apply Security  Filter on Both Sides" when joining BRIDE and BRIDGE1

    In Manage Roles:

     

    Hope I answered your RLS. If so, please provide Kudos and encourage me.