Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not 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 element

selectionManager.select(d.selectionId);
 
I need to refresh the options.dataview[0], in order to refresh the data and refresh my svg element.
What do you recommend to have this functionality?
Is it possible to update the metric name slicer selected value? 
 
Please help, thank you.
 

PowerBI SVGPowerBI SVG

3 REPLIES 3
v-evelk
Microsoft Employee
Microsoft 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
Not applicable

Hello,

after call applyJsonfilters, how can I update the data in options.dataViews[0] ?

 

Anonymous
Not 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);
 
jsonfilters.jpg
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!
 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.