Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JinHe
Frequent Visitor

[powerbi-client-react] Is there a way to modify the selected value of the filter?

I integrated a report using powerbi-client-react, and the customer requested to extract some common filters that can be filtered externally, It is best to have internal and external filter linkage. 

For eg. there is a site filter within the report, I want to create a site filter on an external page as well. How can I pass the external filter to the report and monitor changes to the internal filter in the report?

site-filter.png

According to my investigation, getFilters and setFilters are the closest solutions. control-report-slicers 

But there is no way to control the default value of the filter, also cannot find the ‘filterApplied’ event.

Can anyone help?

 

1 ACCEPTED SOLUTION

Hi @JinHe ,

 

Thanks for the follow-up! You're correct, Power BI’s current embed API doesn't directly support setting default selected filter values inside a slicer or tracking filter changes via a dedicated filterApplied event.

However, we can achieve the same goal using a combination of available tools.

You can pass filters from your external UI into the embedded Power BI report using setFilters() or updateFilters(). This means when a user selects something in your custom dropdown (like "Cambridge" or "Harlow"), you can apply that selection inside the report.

While you can't define "default selected" items directly in the filter model, you can simulate it by automatically applying a filter right after the report loads.

 

There's no direct event like filterApplied, but there are workarounds:

  1. You can listen to the filtersApplied event on the report. This helps detect when filters have been changed (like from a slicer).
  2. If you're using a slicer visual, you can use getSlicerState() to check what values are selected, and use that to update your external UI accordingly.
  3. You may also consider calling getFilters() when needed to fetch current filter states.

vbmanikante_0-1748367196922.png

 

 

Use slicers in Power BI embedded analytics | Microsoft Learn

GetSlicerState from a Custom Slicer - Microsoft Fabric Community

 

If the issue still persists, I’d recommend raising a support ticket with Microsoft. The support team can look into the backend and provide more in-depth assistance tailored to your environment.

https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!

 

Regards,

B Manikanteswara Reddy

View solution in original post

3 REPLIES 3
v-bmanikante
Community Support
Community Support

Hi @JinHe ,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

 

It looks like the issue you're facing is very similar to one that other users encountered earlier. Those issues have been resolved, and the solutions might be helpful in your case as well.

 

Solved: Power BI Embed in React app - Microsoft Fabric Community

Solved: Embedded Report add filter to EmbedConfig - Microsoft Fabric Community

Embed Power BI on React App with filters coming fr... - Microsoft Fabric Community

The last one was not closed, but solution might helpful for our scenario.

 

Please refer to the posts linked below for the full explanation and steps:

Use filters in a Power BI embedded analytics report | Microsoft Learn

How to embed a Power BI item in a React app | Microsoft Learn

Embed Power BI report in a Power BI embedded analytics application for your customers - Power BI | M...

CategoryEntry.FilterApplied Event (System.Activities.Presentation.PropertyEditing) | Microsoft Learn

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!

 

Regards,

B Manikanteswara Reddy

 

 

 

 

Sorry, there is no solution that meets my needs.

const basicFilter = {
  $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Store",
    column: "Count"
  },
  operator: "In",
  values: [1, 2, 3, 4],
  filterType: models.FilterType.BasicFilter
};

Because there are two problems that cannot be solved:

  1. Please see the official filter model above. The default selected item cannot be defined in the filter model.
  2. Cannot find the ‘filterApplied’ event in the embedConfig.

Hi @JinHe ,

 

Thanks for the follow-up! You're correct, Power BI’s current embed API doesn't directly support setting default selected filter values inside a slicer or tracking filter changes via a dedicated filterApplied event.

However, we can achieve the same goal using a combination of available tools.

You can pass filters from your external UI into the embedded Power BI report using setFilters() or updateFilters(). This means when a user selects something in your custom dropdown (like "Cambridge" or "Harlow"), you can apply that selection inside the report.

While you can't define "default selected" items directly in the filter model, you can simulate it by automatically applying a filter right after the report loads.

 

There's no direct event like filterApplied, but there are workarounds:

  1. You can listen to the filtersApplied event on the report. This helps detect when filters have been changed (like from a slicer).
  2. If you're using a slicer visual, you can use getSlicerState() to check what values are selected, and use that to update your external UI accordingly.
  3. You may also consider calling getFilters() when needed to fetch current filter states.

vbmanikante_0-1748367196922.png

 

 

Use slicers in Power BI embedded analytics | Microsoft Learn

GetSlicerState from a Custom Slicer - Microsoft Fabric Community

 

If the issue still persists, I’d recommend raising a support ticket with Microsoft. The support team can look into the backend and provide more in-depth assistance tailored to your environment.

https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!

 

Regards,

B Manikanteswara Reddy

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.