Forum Discussion

Krish_nidar's avatar
Krish_nidar
Icon for Helper I rankHelper I
1 year ago
Solved

Row Level Security only with AZ group

Hi Friends, It would be great ,if i get soution for beow

 

We are having five departments each department need to see their respective pages.

Users are grouped in AZ groups.

AZ group table as below

 

 

 

Target page navigation measure

 

 

TargetPage =

SWITCH(

    TRUE(),

    USERMEMBEROF("az_moi_dp_pbi_admins"), "Admin",

    USERMEMBEROF("az_moi_dp_den_developers"), "HR",

    USERMEMBEROF("az_moi_dp_pbi_developers"), "Finance",

    "Home"

)

  • Hi Krish_nidar  - there is no function with usermemof ,

     

    can you try the below logic:

     

    TargetPage =
    VAR LoggedInUser = USERPRINCIPALNAME()
    RETURN
    LOOKUPVALUE(
    Mapping[TargetPage],
    Mapping[UserEmail], LoggedInUser,
    "Home" -- default if no match
    )

     

    Hope this helps. 

5 Replies

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Krish_nidar ,

    Thank you for reaching out to Microsoft Community.

    Create a role in Power BI like this: [UserName] = USERNAME()
    This will filter the AZ_Group_Table to only include the logged-in user’s row(s). If multiple users share a group, they can have multiple rows.
    Since the Dept field connects AZ_Group_Table to each department table, once RLS is applied, users will only see rows in the related tables for their department.
    Validate RLS: Use “View as Role” in Power BI Desktop to simulate each user.
    Instead of hardcoding AZ Groups in TargetPage, use the filtered Dept from RLS. Here's a revised version:

    TargetPage = SELECTEDVALUE('AZ_Group_Table'[Dept], "Home")


    This way, when the user logs in, RLS filters the table to their row, and TargetPage gives the department name directly.

    Hope this helps!
    Warm regards,
    Chaithra E.

  • Hi Krish_nidar  - there is no function with usermemof ,

     

    can you try the below logic:

     

    TargetPage =
    VAR LoggedInUser = USERPRINCIPALNAME()
    RETURN
    LOOKUPVALUE(
    Mapping[TargetPage],
    Mapping[UserEmail], LoggedInUser,
    "Home" -- default if no match
    )

     

    Hope this helps. 

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Krish_nidar ,

    Thank you rajendraongole1  for your input.
    We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

    Thank you for your patience and look forward to hearing from you.

    Best Regards,
    Chaithra E.

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Krish_nidar ,

    I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.

    Thank you.

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Krish_nidar ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.