Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
VeenaAnalyst
Frequent Visitor

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).

VeenaAnalyst_0-1711891347154.png

Another is the sales table showing sales data for employee.

VeenaAnalyst_1-1711891402036.png

When an employee "Leia Organa" view the report she should see data for the groups she is assigned (Technical chief group ,cloud computing group) as well as her reportees data.

reportees Hierarchy.

VeenaAnalyst_4-1711891741506.png

 

This should be the final result in powerbi. 

VeenaAnalyst_3-1711891628236.png

Immediate help would be appreciated!

1 ACCEPTED SOLUTION
Chakravarthy
Resolver II
Resolver II

Hi @VeenaAnalyst 

This should be model

Chakravarthy_0-1711910427450.png

This should be Joins between tables:

Chakravarthy_1-1711910492133.png

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
Chakravarthy_2-1711910651889.png

In Manage Roles:

Chakravarthy_3-1711910808978.png

 

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

View solution in original post

5 REPLIES 5
VeenaAnalyst
Frequent Visitor

Thanks for you reply @Chakravarthy . But here it shows data for only that particular employee. It doesnt show data for their reportees. If I select " Leia Organa", it should show data for 1.  " Leia Organa" 2. Kylo Ren 3.Darth Maul.   Leia Organa is Manager of Kylo Ren and Darth Maul.

@VeenaAnalyst When I select "Leia Organa" It is showing "Kylo Ren" and "Darth Maul" Below is the screenshot 

Chakravarthy_0-1711959030244.png

 

@Chakravarthy .Kindly ignore previous reply\post since it worked !. Ihere was issue in relationship between Distinct_emp and Bridge table. After I correct that it worked !!Thanks. Accepted as solution. Thanks for your immediate help!.

Hi @Chakravarthy , I have created tables and relatioship as shown by you. But it is not working.

VeenaAnalyst_0-1711960032907.png

Not sufre where it goes wrong.

VeenaAnalyst_1-1711960064278.png

Could you please send your .pbix file to refer?

Chakravarthy
Resolver II
Resolver II

Hi @VeenaAnalyst 

This should be model

Chakravarthy_0-1711910427450.png

This should be Joins between tables:

Chakravarthy_1-1711910492133.png

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
Chakravarthy_2-1711910651889.png

In Manage Roles:

Chakravarthy_3-1711910808978.png

 

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.