Using the Advanced Filter API
Step by step guide how to build simple Slicer Visual
The Advanced Filter API is introduced in the version 1.7.0 of PowerBI Visuals Tools and enables complex cross-visual data-point selection/filtering queries based on multiple criteria (such as “LessThan”, “Contains”, “Is”, “IsBlank”, etc.).
The Sample Slicer visual makes use of the Advanced Filter API for the bulk selection of multiple data-points with just a single selection query. The query is generated based on the position of the sliders that intuitively define the selection range.
The Sample Slicer visual has all selection-related logic concentrated in one file selectionBehavior.ts.
The method below constructs the filter object and passes it along to the main visual module in sampleSlicer.ts.
The main module then invokes the filter using the method applyJsonFilter() on the host interface IVisualHost provided to the visual in the constructor.
Please note the strings “general” and “filter” refer to the filter entry we added to capabilities.json as follows:
The entry enables communication of selection-related information between the visual and the hosting application.
For the complete description of the Advanced Filter API please refer to the link.