Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |