Forum Discussion
Anonymous
7 years agoNot applicable
Custom visual Table using Javascript : Filter Row, Column and single Cell
Hi everybody, I am writing here hoping to find someone who can help me to find the correct way to develop a custom table visual for power BI. At this moment I am able to take data from capabilite...
- Anonymous7 years ago
I solved by my self.
Here is the fragment of code I have used, maybe it could help others.
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] { return dataView.table.identity.map((identity: data.SelectorsByColumn) => { const categoryColumn: DataViewCategoryColumn = { source: dataView.table.columns[1], values: null, identity: [identity] }; return host.createSelectionIdBuilder() .withCategory(categoryColumn, 0) .createSelectionId(); }); }Using this I am able to filter the table by row. I am talking abot versione 2.5.0. The version for 1.6 suggest by someone on internet is:
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] { return dataView.table.identity.map((identity: DataViewScopeIdentity) => { const categoryColumn: DataViewCategoryColumn = { source: dataView.table.columns[0], values: null, identity: [identity] }; return host.createSelectionIdBuilder() .withCategory(categoryColumn, 0) .createSelectionId(); }); }Thank you anyway,
Francesco Multari
v-evelk
Microsoft Employee
7 years agoHi,
There is no documentation with examples for a while but yes, you need to set rowNumber and colNumber like here.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
Anonymous
7 years agoNot applicable
I solved by my self.
Here is the fragment of code I have used, maybe it could help others.
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
return dataView.table.identity.map((identity: data.SelectorsByColumn) => {
const categoryColumn: DataViewCategoryColumn = {
source: dataView.table.columns[1],
values: null,
identity: [identity]
};
return host.createSelectionIdBuilder()
.withCategory(categoryColumn, 0)
.createSelectionId();
});
}Using this I am able to filter the table by row. I am talking abot versione 2.5.0. The version for 1.6 suggest by someone on internet is:
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
return dataView.table.identity.map((identity: DataViewScopeIdentity) => {
const categoryColumn: DataViewCategoryColumn = {
source: dataView.table.columns[0],
values: null,
identity: [identity]
};
return host.createSelectionIdBuilder()
.withCategory(categoryColumn, 0)
.createSelectionId();
});
}
Thank you anyway,
Francesco Multari