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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HMEUserAnup
New Member

RLS with multiple roles not working with embedded reports

Hi,

 

we are trying to implement RLS feature in the .net application using PowerBI embed and are trying to pass multiple roles based on which the logged in user should see the filtered report on the client side.  When we are sending a single role, the reports are getting perfectly displayed, But when we are sending multiple roles (roles, users and rules which are already configured for specific report in the powerbi desktop), it shows us with the following error on to the client-side:

 

HMEUserAnup_0-1654612789853.png

 

Following is the screenshot of the code that we have implemented at our end : 

HMEUserAnup_1-1654612925858.png

 

 Is it possible to display the report based on multiple roles through code approach?

 
And if so, Is there any documentation/code example/feeds where i can look into?

Thanks,

Anup

 

 






 

3 REPLIES 3
Anonymous
Not applicable

 

https://docs.microsoft.com/en-us/rest/api/power-bi/embed-token/reports-generate-token-in-group#gener...

 

{
    "accessLevel": "View",
    "identities": [
    {
        "username": "john@contoso.com",
        "roles": [
            "sales"
        ],
        "datasets": [
            "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
        ]
    }
    ]
}

v-yiruan-msft
Community Support
Community Support

Hi  @HMEUserAnup ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

Hi  @HMEUserAnup,

You can refer the following links to use Row-level security with Power BI Embedded:

Row-level security with Power BI Embedded

Works with Row Level Security in Power BI and Power BI Embedded yingyinr_1-1654841800565.png
Manage roles in ServiceManage roles in Service

POWER BI EMBEDDED & RLS

 

And the following ones are the threads which have the similar problem as yours, please review their solutions and check if they can help you resolve the problem.

Can't display the visual

Think this is it...

https://www.sqlbi.com/blog/marco/2021/06/03/setting-the-right-permissions-for-users-of-composite-mod...

you need to also grant build permission in the same way.


Tip: "Can't Display the Visual" on embedded caused by RLS role mismatch.


Please check if your Row level Security roles are matching what role your embedded applications has setup. For instance, if you have "User" as your expected role in your report, and your application attempts to apply a nonexistant role of "Account" to the report. You will get an errorf for each visualization saying: "Can't Display the Visual. See Details."


Getting "Can't display this visual" error


I actually had this error today.  It was caused by another visual that had a deleted column as a filter.  I guess the cross-filtering capability of visuals was generating the error.

Check all your visuals for deleted columns or measures.


Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.