Forum Discussion
Embed power bi report with predefined parameters using C#
Hello everyone,
I'm new to Power BI, and I've been assigned the task of embedding a Power BI report into a web application. I've been following the guidelines provided by Microsoft (Create an Azure Active Directory tenant to use with Power BI embedded - Power BI | Microsoft Learn) to achieve this. At this point, my goal is to implement report filters using C# code. What I'm aiming for is to load my application with the embedded report and have predefined parameters set automatically. Could someone please assist me with accomplishing this task? Your help would be greatly appreciated.
4 Replies
- ibarrau
Super User
Hi. If you are talking about embedding a secure link at web portal, then you can check this doc: https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-embed-secure?toc=%2Fpower-bi%2Fdeveloper%2Fembedded%2FTOC.json&bc=%2Fpower-bi%2Fdeveloper%2Fembedded%2Fbreadcrumb%2Ftoc.json
At the same index of docs you can also find the embedded big deal, the one that will let you do a lot of things and require much more development like https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-customer-app
I hope that helps,
- KaveeMendisNew Member
Hi ibarrau,
Thank you very much for your reply!!!
However, I'd like to modify certain filter values within my Power BI report so that they are applied when the report is being embedded.
var config = { type: 'report', id: reportId, embedUrl: embedUrl, accessToken: token, permissions: models.Permissions.All, tokenType: models.TokenType.Embed, viewMode: models.ViewMode.View, settings: { panes: { filters: { expanded: false, visible: true }, pageNavigation: { visible: false } } } };
I understand how to control the visibility and expansion of report filters. But what I'm wondering is, can we actually change the filter conditions themselves? For instance, if I want to set a filter like 'Age < 30,' how would I go about doing that within Power BI?
- ibarrau
Super User
I'm not sure about the specific scenario, however you can explore the features of embedded and how they work at the playground: https://playground.powerbi.com/en-us/explore-features
When you click on an action you can check how it's done and if it's the action you were looking for.
I hope that helps,