The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello!
I have an app that changes the measure of the charts based on the selected value in the field parameter. It’s working fine from the portal, but how do I change the value of the parameter field when the objects are embedded as separate visuals on a webpage?
Additional Info:
Here’s the expected behavior from the portal (app.powerbi.com)
Any leads from the community are much appreciated!
Hi @jdy_ums ,
To change the value of a field parameter in an embedded Power BI report, you can use the setFilters method of the Power BI JavaScript API:
let report = powerbi.embed(reportContainer, embedConfiguration);
// Get the existing filters
let filters = await report.getFilters();
// Find the field parameter filter
let fieldParameterFilter = filters.find(filter => filter.filterType === "FieldParameter");
// Change the value of the field parameter
fieldParameterFilter.values = ["New Value"];
// Apply the updated filters
report.setFilters(filters);
Best Regards
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
1 | |
1 | |
1 |