This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I have a custom visual I am working on where I am building out a map with leaflet & trying to add in the ability to click on the map and have it filter the other visual on the page.
I am looking at the following docs
https://github.com/PowerBi-Projects/PowerBI-visuals/blob/master/Visual/Selection.md
https://learn.microsoft.com/en-us/power-bi/developer/visuals/selection-api
Whjen I try to add this
const categorySelectionId = this.host.createSelectionIdBuilder()
into either my update or constructor for my visual I get the error
Property 'createSelectionIdBuilder' does not exist on type 'IVisualHost'.
I am running powerbi-visuals-tools version - 5.5.1 and have the following versions in package.json
"powerbi-visuals-api": "~5.3.0",
"powerbi-visuals-utils-dataviewutils": "^6.1.0",
"powerbi-visuals-utils-formattingmodel": "6.0.0",
"powerbi-visuals-utils-interactivityutils": "^6.0.4"
What am I doing wrong here?
Hi, @Grzy7316
1.Firstly, have you correctly imported the relevant variables:
import IVisual = powerbi.extensibility.IVisual;
import IVisualHost = powerbi.extensibility.visual.IVisualHost;
2.Secondly, I recommend checking whether you have created class properties for both the host and the selection manager.
private host: IVisualHost;
private selectionManager: ISelectionManager;
For further details, please refer to:
3.Next, please refer to the following code for the IVisualHost interface services:
export interface IVisualHost extends extensibility.IVisualHost {
createSelectionIdBuilder: () => visuals.ISelectionIdBuilder;
For further details, please refer to:
powerbi-visuals-api/src/visuals-api.d.ts at main · microsoft/powerbi-visuals-api · GitHub
Visual API for Power BI Visuals - Power BI | Microsoft Learn
4.Here are some relevant example links that I hope will be helpful to you:
PowerBI-visuals-sampleBarChart/src/barChart.ts at main · microsoft/PowerBI-visuals-sampleBarChart · ...
Adding Interactions To Your Power BI Custom Visual
Solved: Visuals interactions - Microsoft Fabric Community
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |