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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
renjithpbi
Frequent Visitor

RLS Manager Supervisor design

Hi All, 

 

I would like to implement RLS for Manager and Supervisor setup for below sample table. 

In this example, A is a Manager and B and C are not Managers.

For B and C they should see only their details, 

For A should see all the Country details, because A is a manager. 

 

EmployeeEmailCountryManager_Y/N
Aaaa@test.comUKY
Aaaa@test.comUKY
Bbbb@test.comUSN
Cccc@test.comCANN

 

Appreciate your help!

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @renjithpbi,

I think you can add to extract the manager field value as condition. If the current user is manger, not apply filter on the user email field and he can view all records.
If the current user not the manager, use current username as RLS filter condition on the email field to filter records.

Row-level security (RLS) with Power BI - Power BI | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Sorry, I am re writing my request once again here , that Manager also can be Supervisor where when A logs in,

He should see Country UK + CAN so he should see Sales  = 35, B and C should see their sales. 

 

EmployeeEmailCountryManager_Y/NSales
Aaaa@test.comUKY10
Aaaa@test.comUKY20
Bbbb@test.comUSN15
Cccc@test.comCAN

N

25

Aaaa@test.comCAN

N

5

 

HI @renjithpbi,

Did you mean if user is the manager, he should be permission to view the country records which he managed and his records?

If that is the case, you can try to use the following formulas if suitable for your requirement:

VAR ManageredCountry =
    CALCULATETABLE (
        VALUES ( Table1[Country] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Manager_Y/N] = "Y"
                && Table1[Email] = USERPRINCIPALNAME ()
        )
    )
VAR isManager =
    COUNTROWS (
        FILTER (
            ALLSELECTED ( Table1 ),
            Table1[Manager_Y/N] = "Y"
                && Table1[Email] = USERPRINCIPALNAME ()
        )
    )
RETURN
    OR (
        AND ( isManager > 0, Table1[Country] IN ManageredCountry ),
        Table1[Email]= USERPRINCIPALNAME ()
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Gabry
Responsive Resident
Responsive Resident

Do you know anything about RLS? What's your issue on implementing this?

You should just create a rule, check if the user loggedin is B or C and if so filter the table as you want.

 

If you have a specific issue please detail it, if not just check a video on youtube on how to implement RLS

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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