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
mayurkotlikar
Frequent Visitor

Power BI Embedded with validation

Hello,

 

This is my first post. If I have posted at wrong place, please help me post at correct forum.

 

Background:

 

In one Web application of ours, which is authenticated we have links to download a PBIX files. The idea was to provide a Power BI report which the user can download and open with Power BI desktop.

Once downloaded, the user can then click on "Refresh", which will prompt the user for user credentials. The user get authenticated, the Report is then rendered with data available to the user. This was all handled via Desktop.

The connection is via a autheticated OData service.

 

Now, our intention is to say "embed" a report, such that the user does not have to download the report, rather can see the report on a page of web application.

The users that we have do not come along with any Azure or Power BI subscription of their own.

 

 

While trying out the embedded option, I provisioned the workspace and imported the report. I used that report to embed and run across following problems:

 

1. The report does render but the data that is visible is that of the user who "imported" the report. i.e. my account & not the logged in user

2. I looked at various QueryString or parameters for the Embedded but could not found a way to pass on the credentials or user information for quering user specific data

3. I could not see an option to customize the DataSet before import such that the imported PBIX is just a template or Structure instead of Structure + Data.

 

Question:

What is the way to embed a Power BI report in a web application so that the authenticated user can see specific data? I could not find any resource.

Also, if not embedded, what is another way of supporting such basic requirement of showing a report in web application

I also explored if I can use Direct Query instead of OData service, but basic requirement of sending credentials or user information still stays.

 

I will be great if someone can point me to a solution about how this can be done.

 

Regards,

~Mayur

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@mayurkotlikar What you need is Row Level Security (RLS) implemented on your pbix file. Check out this blog post that goes through on how to implement RLS for power bi embedded.

View solution in original post

4 REPLIES 4
mayurkotlikar
Frequent Visitor

So, the Row Level Security and Update to the Nuget package did the trick.

 

Only change I did in code was to pass on the user name via PowerBIToken.CreateReportEmbedToken().

 

 

ankitpatira
Community Champion
Community Champion

@mayurkotlikar What you need is Row Level Security (RLS) implemented on your pbix file. Check out this blog post that goes through on how to implement RLS for power bi embedded.

I tried the example from the link and it does not work for me.

 

The report is always rendered with all the records. I used PowerBIToken.CreateReportEmbedToken to pass on the user name as parameter and followed each step.

Thanks for the link, I will try. We dont have Roles but I can fake one.

 

The part that I have not understood is the "app token". I am not sure how I can pass on the token with username: and role:.

Do you know how can I send it?

 

For embedded I just use the url which I get from the Report object.

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.