Forum Discussion
Anonymous
6 years agoNot applicable
Cusstom Visual refresh dataset
Hello. I have a custom visual with a slicer filter and an svg element with nodes and links(please see image below) I have an onclick event in the circle, I have the selectionId for the elemen...
v-evelk
6 years agoMicrosoft Employee
Hello,
Sorry for the late answer.
I see that my colleague has already answered you by e-mail so, I will transfer his answer here.
"If you try to filter data in slicer, that works with metrics -- it's impossible.
Visuals can't filter data in slicer visuals by using SelectionID's.
You need to use Filter API:
https://docs.microsoft.com/en-us/power-bi/developer/visuals/filter-api
"
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
Anonymous
6 years agoNot applicable
hello,
I've apply a basic filter using this code:
//Apply a Basic filter
var basicFilter : IBasicFilter = {
target: {
table: "Dim_MetricRelationships",
column: "Metric Branch"
},
operator: "In",
//values: ['Excess M&S', 'PO Compliance - Inventory'],
values: Visual.metricList,
filterType: models.FilterType.Basic
};
this.host.applyJsonFilter(basicFilter, "general", "filter", FilterAction.merge);
How can I refresh the data based on this basicfilter?
Right now If I see values on options.dataViews[0] I only see data for one metric.
I need to be able to get the data based on this new filter.
Please let me know your comments. thank you!