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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
dakdgdl
Helper I
Helper I

How to access filters collection of filter panel

Hi..

 

I need to programatically access the filters collection of filter panel of custom visual, at update method. If the whole filter collection is not accessible, it is enough having a boolean value true/false, to identify at-least a single filter is applied by the user, when current trigger of update method.

 

Can anyone advise how to access it or identify it programatically?

 

Thanks in advance..

Lasantha

4 REPLIES 4
Sahir_Maharaj
Super User
Super User

Hi Lasantha,

 

To check if a filter is applied by the user in the update method of a custom visual, you can check the "jsonFilters" property of the "VisualUpdateOptions" object. This property contains an array of JSON filter objects, which represent the filters that have been applied by the user.

 

If the "jsonFilters" property is not empty, then at least one filter is applied. Otherwise, if it is empty, then no filters are applied. Here is an example of how you can check if a filter is applied by the user in the update method of a custom visual:

 

update(options: VisualUpdateOptions) {
    // Check if at least one filter is applied
    let isFilterApplied = options.jsonFilters.length > 0;
    // Do something with the filter applied boolean value
}

 

You can also check the "jsonFilters" property to access the filter details like filter name, filter values, filter type, etc.

 

Hope this helps 🙂

 

Kind Regards,

Sahir


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Sahir_Maharaj
Super User
Super User

It's important to note that the filter collection returned by the enumerateObjectInstances method is an array of filter objects, that contains various properties such as the filter name, filter type, filter values and etc. You can use them in your update method code according to your requirements.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Sahir_Maharaj
Super User
Super User

Hi Lasantha,

 

In Power BI, you can programmatically access the filters collection of the filter panel of a custom visual at the update method by using the "enumerateObjectInstances" method of the "VisualObjectInstanceEnumeration" object. This method allows you to retrieve an array of objects representing the filter objects in the filter panel, which can then be accessed and manipulated in your update method code.

 

To check if at least one filter is applied by the user, you can check the length of the array returned by the "enumerateObjectInstances" method. If the length is greater than 0, then at least one filter is applied. Otherwise, if the length is 0, then no filters are applied.

 

Here is an example of how you can programmatically access the filters collection of the filter panel in the update method of a custom visual:

 

update(options: VisualUpdateOptions) {
    // Get the filter collection
    let filterCollection = options.objectEnumeration;
    // Check if at least one filter is applied
    let isFilterApplied = filterCollection.length > 0;
    // Do something with the filter collection or filter applied boolean value
}

 

Hope this helps 🙂

 

Kind Regards,

Sahir

 

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hi Sahir...

 

Thank you for responding...

I checked this way. But it has only below properties. Not available a property named "objectEnumeration".

I also have impemented "enumerateObjectInstances" method. There also it returns only the persistsProperies.

 

export interface VisualUpdateOptions extends extensibility.VisualUpdateOptions {
        viewport: IViewport;
        dataViews: DataView[];
        type: VisualUpdateType;
        viewMode?: ViewMode;
        editMode?: EditMode;
        operationKind?: VisualDataChangeOperationKind;
        jsonFilters?: IFilter[];
        isInFocus?: boolean;
    }
 
Thanks..
Lasantha

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors