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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ITInge
Frequent Visitor

Power BI SDK don't get or set filters when "all filters" is selected on online report

I'm trying to set dynamically filters from JS using Power BI SDK.

When I check on Power BI service the filters to "select all" 

ITInge_0-1611771925660.png

 

then in my JS code  get filters as bellow 

 

    rapport.getFilters().then(data => {
      console.log("filters data", data)

 

I'm getting an empty array :

ITInge_1-1611772027404.png

 

Secondly when I try to set filter using setFilters API nothing happens
 

 

    report.setFilters(filters)

 


Here's what I send in 'filters'

ITInge_2-1611772191844.png
My code works only in one case:

When I go to power bi service and uncheck selectAll then check one by one the filters.

ezgif-3-1d24e600ea91.gif

 

 

In this case , when I setfilter the embedded view is getting updated. But in my case I'm generating reports automatically so I get go to pbi online and check every filter, I should keep default "select all" checked and set filter from front end.

any solution to set filters programmatically with default checked "selected all " ?

 

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

Hi @ITInge ,

It seems that currently there is no property to achieve it, please review the content in the following thread:

All possible report filter values in javascript api

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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