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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mroot
Frequent Visitor

ISelectionIds getting reassigned

I am assigning selectionIds to my data points with the following loop:

 

let dataViews = options.dataViews //options: VisualUpdateOptions
let categorical = dataViews[0].categorical;
let dataValues = categorical.values;

for(let dataValue of dataValues) {
    let values = dataValue.values;
    for(let i = 0, len = dataValue.values.length; i < len; i++) {
        let selectionId = host.createSelectionIdBuilder()
            .withCategory(categorical.categories[0], i)
            .withMeasure(dataValue.source.queryName)
            .withSeries(categorical.values, categorical.values[i])
            .createSelectionId();
    }
}

 

In a powerBi report when I select a data point from another visual the update method is called on my custom visual class.  It appears to me that my dataView gets filter to only include that selected data point I clicked from the other visual.  What also seems to happen is that the data points from the other visuals are given new selectionIds.  But I am only given one of the data points to reassign. How do I keep the selection Ids from all my data points (not just the data point that has been selected from another visual) in sync with other visuals when there has been a selection?

 

Thanks!

 

Matt 

 

1 ACCEPTED SOLUTION
1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.