Forum Discussion

Nikolainoergard's avatar
Nikolainoergard
Frequent Visitor
1 year ago
Solved

Hierarchical RLS with report subcriptions

Hi I'm looking for a solution to apply RLS with pathcontains and userprincipalname to report subcriptions. Anyone who has experience with a solution to that, or could send me in a direction of how t...
  • v-kpoloju-msft's avatar
    1 year ago

    Hi Nikolainoergard,
    Thank you for reaching out to the Microsoft fabric community forum. I have identified few alternative workarounds that may assist in resolving the thread.

    You're absolutely on the right track using PATHCONTAINS() and USERPRINCIPALNAME() for hierarchical RLS in Power BI. However, the challenge you're encountering with subscriptions is a known limitation.

    Power BI email subscriptions do not run under the signed-in user's context. Instead, they are executed using a Power BI service account. As a result, functions like USERPRINCIPALNAME() won’t return the intended user identity during subscriptions, which prevents RLS from working as expected. For more details, see: Understand Power BI report subscriptions

    Use Paginated Reports (Preferred if you have Premium or PPU): Paginated Reports support parameterized subscriptions, which lets you filter data per user even during scheduled delivery.

    • Build a report with a user email parameter
    • Filter using SQL or DAX where PATHCONTAINS(HierarchyPath, @UserEmail)
    • Schedule personalized subscriptions per user

    Automate Personalized Delivery via Power Automate / REST API: For dynamic personalization:

    • Export report per user using Power BI REST API
    • Use effectiveIdentity to impersonate the user
    • Email the personalized file via Power Automate or Logic Apps

    Kindly refer to the below documentation links for more information:
    Export report using REST API
    Row-level security with embedded analytics

    Interactive Access Only: If subscriptions are not a strict requirement, interactive report access within the Power BI Service will honor RLS correctly using USERPRINCIPALNAME().

    Let us know your license (Pro, PPU, or Premium) and how many users you’re planning to support via subscription we can tailor a recommended solution from there. 

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

    Thank you for using Microsoft Community Forum.