Forum Discussion

InsightsByV's avatar
InsightsByV
Super User
1 year ago
Solved

Implement Dynamic RLS with Azure Security Group

Hi,   Please help me with your valuable knowledge on the issue I am working on:  Background:  I have a report for which i have applied page level security -RLS as this report was required to be...
  • v-karpurapud's avatar
    1 year ago

    Hi InsightsByV 

    Thank you for reaching out to the Microsoft Fabric Community Forum.
     

    Power BI Row-Level Security (RLS) requires a defined relationship in your data model to filter data using Azure Active Directory (AAD) group memberships. Power BI cannot dynamically check group memberships within DAX at runtime.

    As rohit1991  mentioned, you can automate the extraction of user-to-group membership data from Azure AD with Microsoft Graph API or PowerShell scripts. Store this mapping in a refreshable source like a SharePoint List, Azure SQL Database, or a Dataflow in Microsoft Fabric to keep it updated as your organization changes.

    The user-group mapping table should include at least UserPrincipalName and GroupName columns. You can join this table with your RLS permissions table on GroupName to build the necessary relationship. In Power BI Desktop, set up RLS by creating a DAX filter in Manage Roles, such as [UserPrincipalName] = USERPRINCIPALNAME(), on the mapping table.

    With this setup, when a user accesses the report, RLS will filter the data to show only what is relevant to the security groups the user belongs to, based on the pre-loaded mapping.


    I hope this information is helpful.  If this does not helps please share more details so we can assist you further.

    Regards,
    Karpurapu D,
    Microsoft Fabric Community Support Team.