top of page

Solution For Filter In Power BI Embedded

If your organization is use Power BI reports and dashboard you may have a issue with increasing number of viewers that you have. As for a solution Organization will increase number of viewers in Power BI web portal. It is no need to increase viewers in Power BI because you can do it in another way.


You can use Power BI secure embedded code for that but the problem is how to handle row level security.


So in this post I will guide you to handle that part.


Let's get start !

Step 1

You need to register your app in Microsoft Azure. I have already create a application I will show you how its done. Its easy.


Go to Azure Active Directory and Click App Registration then click New registration. Give a name to your App and register it.






Now click on your newly created App and copy Application (client) ID, Directory (tenant) ID. Then go to Certificate & secrets and create a New Client Secret. You need to copy the Secret Value(Not Id).



These IDs need for create Embedded token and permissions.


Step 2

You need to create you Power BI report using Power BI Desktop. You can create any Power BI report that you want but make sure that you include user name, Email or any other identification in your report. Refer below data model.

Create a work space in Power BI server and upload you report into Power BI server.

Go to your report in Power BI service then copy the group Id (workspace Id) and report Id in URL.

Now you have 5 IDs. Make sure you have get all mentioned IDs below

  1. Application (client) ID

  2. Directory (tenant) ID

  3. Client Secret

  4. Group Id

  5. Report Id

Step 3

Go to Microsoft Github Account and download power bi developer sample.

Extract the zip file and find AppOwnsData.sln which is located at "\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers" directory. Open the AppOwnsData.sln. I will recommend to use Visual Studio.

Now navigate to appsettings.json and copy and paste the IDs that you found previously.

Now go to index.js which is located at inside the wwwroot.

This is the last part. Our goal is handle the access level in Power BI report. So we have to use filter option inside the code. I have created a code and you can edit it and apply. Refer the below image and pay attention to highlighted area.

You can use the session and capture the username and assign to var UserName.

Now run the program and you can see data is filtered. This is how we can filter external customers.


I hope you get some idea about how to filter external customers.

Good Luck!

Comentários


Subscribe Here.

Thanks for subscribing!

+94766088392

Colombo, Sri Lanka.

  • LinkedIn
  • Facebook
  • Instagram
bottom of page