cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
jdy_ums
Regular Visitor

Change Field Parameter value in an embedded app

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)

 field parameter.gif

 


Any leads from the community are much appreciated!

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

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

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors