Forum Discussion

rafabelokurows's avatar
rafabelokurows
New Member
1 year ago
Solved

Share single report with clients, change data according to user

Hi, everyone. Sorry if this have been asked before, but I haven't found it.   My current company has one Power BI report for each client (few clients for now, but looking to scale). We would like ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi rafabelokurows,

     

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

     

    Yes, this can be achievable with power bi embedded.


    here are the steps to Implement the approch:

    1. Set Up RLS in Power BI Desktop create a role, and set a filter using USERPRINCIPALNAME() to match user identity (e.g., email). Test the role using "View as Role" to ensure correct filtering.

    2. Publish to Power BI Service Click Publish in Power BI Desktop and select your workspace.

    3. Register App in Azure AD In Azure Portal, register your app to get credentials (App ID & Secret) for embedding.

    4. Generate Embed Token Use the Power BI REST API to create a token that passes user identity (email/client info) securely.

    5. Embed Report in Your App Use Power BI Embedded to show the report in your web app. Data filters automatically per user via RLS.

    The "parameter switch" works by passing the logged-in user's identity (like email or client ID) through an embed token using Power BI Embedded. Power BI uses that identity in either:

    Row-Level Security (RLS) with USERPRINCIPALNAME() or CUSTOMDATA() to filter data in Import mode, or

    Dynamic M Query Parameters in DirectQuery mode to modify the SQL query and load only the user’s data from the source.

     

    If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.


    Thank you & regards,
    Prasanna Kumar