Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
10 | |
7 | |
4 | |
4 | |
4 |