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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Calling ISelectionManager.applySelectionFilter() from IVisual.update() sometimes causes an infinite update loop. I developed a custom slicer visual that will automatically choose the first or last item from the category. To do this, I call ISelectionManager.applySelectionFilter() form the first call IVisual.update() after the visual's constructor.
It doesn't happen every time, but is more likely when I publish a report to PBIOnline where the selected value is not the last or first value. Since all of the other visuals in the report are also set to the previous value, it causes the report to load, then reload to the newly seleted value. It seems to happen even when the visuals aren't configured to filter back on my custom slicer.
Anyone else run into this type of problem before? Any recommendations?
Solved! Go to Solution.
Slicer should not be affected by incoming selection but slicers will be filtered by other slicer as well.
Our recommendation is to call applyJsonFilter only for users actions.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Recommendation is to stop calling applyFilter from update as each filter event will force PBI to call update method.
This is why infinity loop might appear.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I think limiting the where and how applySelectionFilter() is called is key.
Durring the call to IVisual.update(), other visuals could have placed some or all of the selected items out of context. What is recommended for this case? I can see two options: (1) clear and make a new selection, or (2) take no action at all, leaving the selection in place.
Option 2 seems like it could leave the visual out of sync with the rest of the report. Since this visual is a slicer, it seems like it should have positive control at all times, and shouldn't have a "empty" state like a chart or grid. Recommendations are welcome...
Slicer should not be affected by incoming selection but slicers will be filtered by other slicer as well.
Our recommendation is to call applyJsonFilter only for users actions.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I updated my code so that the call to ISelectionManager.applySelectionFilter() is called in only two cases.
1) When the user interacts with the slicer
2) On first load, and only if the current selection isn't the first or last (as dictated by the settings).
Origionally the code would call ISelectionManager.applySelectionFilter() when ever the contents of the slicer was updated programatically. In most cases the selection was the same. But, from what I can tell there isn't a chance for a feedback loop any more.
Such solution looks good.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |