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
AntonioCoelho
Advocate I
Advocate I

PowerBI JavaScript - Report Visual not showing default filters on filter panel

Hi,

 

I'm using PowerBI-JavaScript client to render a visual. When a filter is added to the visual that is not part of the fields of the visual, this filter is not appearing on the filter panel. But when I render the Report Page and click on the visual, I can see the filter on the filter panel. See exemple bellow:

 

Visual filter when rendering the Report Page and click on the visual:

Report.png

 

Visual filter when rendering the Visual and click on the visual:

FiltersOnVisual.png

 

Is this a limitation of the API?

 

1 REPLY 1
AntonioCoelho
Advocate I
Advocate I

After further investigation, with the previous versions of powerbi.js (2.7.4) I would set a default filter like this:

 

visual.setFilters("[]")

 

Now, this command is wiping the default filters of the report as you can see in the example above. After making some tests I could verify that if I set the filter with "null" as string the filters are not affected.

 

visual.setFilters("null")

 

So my question is: should I use the newer version visual.setFilters("[]") or visual.setFilters("null") or is this a temporary bug?

 

I have clients complaining about this already!

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.