Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello,
I'm attempting to create a dynamic property that populates object properties based on the available values in a category.
My dataView is defined like so:
{
"categorical": {
"categories": {
"select": [
{ "for": { "in": "group1" } },
{ "for": { "in": "group2" } },
{ "for": { "in": "group3" } }
]
},
"values": {
"select": [
{ "for": { "in": "measure1" } },
{ "for": { "in": "measure2" } },
{ "for": { "in": "measure3" } },
{ "for": { "in": "measure4" } }
]
}
}
}My goal is simple: if there's 3 unique values in group1 (e.g. 1, 2, or 3), then I'd like 3 unique properties under an object in the properties pane, like the example given here, or commonly seen under the "Data Colors" object on a pre-built visual.
However, the linked example creates a unique property for every datapoint, which is not what I want to do at all. If there are 100 values under category 1, 100 under category 2, and 100 under category 3, I only want to see 3 properties, not 300.
Looping over the unique values during Object Enumeration is easy enough, however I'm confused by the creation of SelectionIds. How can SelectionIds be created so that the VisualObjectInstance.selector is referencing a collection of values?
P.S. reading here, it seems like withSeries may help do what I need, but the desciption of it is extremely vague.
For more context, all the dynamic Object Enumeration examples I see are like this:
case 'objectNameStr':
for(let dataPoint of this.dataPoints) {
objectEnumeration.push({
objectName: objectName,
displayName: dataPoint.category,
properties: {
fill: {
solid: {
color: dataPoint.color
}
}
},
selector: dataPoint.selectionId.getSelector()
});
}
break;
But I'm trying to do something more like this:
case 'objectNameStr':
for(let group of uniqueGroups) {
objectEnumeration.push({
objectName: objectName,
displayName: group.value,
properties: {
fill: {
solid: {
color: group.color
}
}
},
selector: [What goes here?]
});
}
break;Thanks in advance.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.