Forum Discussion
marcobaciga
Helper I
8 years agoset value field in report powerbi by custom visual
Hi, I must in m y custom visual to send a value like filter in each visual object in my report powerbi when i click a icon. Is it possible? Thank you Marco
- 8 years ago
This code snippet is going to address the issue:
let selectionIds = []; selectionIds.push(host.createSelectionIdBuilder() .withCategory(categorical.categories[0], 0) .createSelectionId() ); selectionIds.push(host.createSelectionIdBuilder() .withCategory(categorical.categories[1], 0) .createSelectionId() ); selectionIds.push(host.createSelectionIdBuilder() .withCategory(categorical.categories[0], 1) .createSelectionId() ); selectionIds.push(host.createSelectionIdBuilder() .withCategory(categorical.categories[1], 1) .createSelectionId() ); selectionIds.forEach((selectionId) => { this.selectionManager.select(selectionId, true) });Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
v-viig
Community Champion
7 years agoHierarchy Slicer is on legacy API so far but it will be converted to PBI Custom Visuals API soon once multi column filtering API is released.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
dakdgdl
Helper I
3 years agoHi v-viig
I tried cross-filte by cross-select as below.
--------------------------
let rowSelection: ISelectionId = this.visualHost.createSelectionIdBuilder()
.withTable(this.dataView.table, rowIndex)
.createSelectionId();
await this.selectionManager.select(rowSelection, true).then(result => {
console.log(result);
});
-------------------------------
result is just like below
-------------------------
- [t]
- 0: t
- dataMap:
- {"identityIndex":0}: [{…}]
- [[Prototype]]: Object
- deepestNodeLevelInPath: -1
- key: "{\"{\\\"identityIndex\\\":0}\":[{\"identityIndex\":0}]}[]"
- measures: []
- nodeIsCollapsed: null
- [[Prototype]]: Object
- length: 1
- [[Prototype]]: Array(0)--------------------------------
But this didn't cross-select the passed selectionID row in other visuals of the page.
What could be the reason. Any specific config setting in tsconfig, capabilities.json or webpack.config
Please advise.
Thanks in advance,
Lasantha