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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
dm-p
Super User
Super User

How Do We Structure SelectionIDs to Store objects in the Data View Mapping for Series or Measure?

Hi folks,

I'm implementing a visual with similar behaviour to the clustered column chart core visual and have some very similar data bindings for colour in the properties pane. This should ideally bind as per the clustered column chart, i.e.:

  1. If the user provides a series (Legend) field then series values are enumerated and added to the pane.
  2. If the user provides no series (Legend) field but multiple measures, then the measure values are enumerated and added to the pane.
  3. If none of the above are hit, then categories are bound to the pane.

I can actually get the above to list in the pane for each situation, but my challenge is pushing the selectionId into the data view for scenarios 1 and 2 when I select a colour from the palette and persisting the selected value.

The only one that works reliably is 3, which is as per the example. In this case, the generated selectionId is getting pushed into categorical.categories[n].objects as expected.

My dataViewMapping is configured as follows:

"categorical": {
    "categories": {
        "for": {
            "in": "category"
        }
    },
    "values": {
        "group": {
            "by": "series",
            "select": [
                {
                    "bind": {
                        "to" :"measure"
                    }
                }
            ]
        }
    }
}

In the case of where I need to generate a selectionId .withSeries() and/or .withMeasure(), I can get a valid selectionId for the combination of fields.

However, using it with objectEnumeration.push does not put it into the dataView, which I assume should push it into categorical.values[n].objects at the appropriate location. This doesn't seem to happen... or end up anywhere in the dataView that I can find.

Can someone shed any light on how I should be approaching/managing this? It's clearly possible to do but maybe I'm thinking about it the wrong way.

Thanks very much!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




1 REPLY 1
v-evelk
Microsoft Employee
Microsoft Employee

Hi Daniel,

 

You could check the source code of Mekko Chart because it has similar cases.

Please check there and there.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors