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
seregindv
7 years agoFrequent Visitor
No way. I can't wait that long. HierarchySlicer can already do this and I probably can filter in the same way it does. How does it do this?
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
- dakdgdl3 years ago
Helper I
Hi 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.configPlease advise.Thanks in advance,
Lasantha