Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm creating custom pie chart so in that i have to add slice color change functionality.
I have prepared default color array for the categories and creating slice for formate penal.
Below is the code which i have added in setting.ts file
sliceSettings.sliceDropdownItems.forEach((item, idx) => {
slices.push({
uid: `slice_color_uid_${item.value}`,
displayName: `${item.displayName} Color`,
control: {
type: powerbi.visuals.FormattingComponent.ColorPicker,
properties: {
descriptor: {
objectName: 'slices',
propertyName: 'sliceColor',
},
value: {
value: sliceSettings.sliceColorArray?.[idx] || ''
}
}
},
disabled: false
});
});
but when I try to change the color I'm not able the get that changed color details so Please help me on that
capabilities.json
"slices": {
"displayName": "Slices",
"properties": {
"selectedSlice": {
"displayName": "Selected Slice",
"type": { "enumeration": [] }
},
"sliceColor": {
"displayName": "Slice Color",
"type": { "fill": { "solid": { "color": true } } }
}
}
},
I think, I have to set dynamic properties based on categories but I'm not able to find any solution to set dynamic properties.
Solved! Go to Solution.
Hi @NileshBhayani ,
Thanks for reaching out to the Microsoft fabric community forum.
In the current setup, the capabilities.json file defines a single sliceColor property under the slices object, which applies uniformly rather than on a per-category basis. This structure lacks the flexibility to store and retrieve distinct formatting settings for each slice. As a result, while colour pickers may appear in the formatting pane, the visual cannot persist or retrieve category-specific colour selections at runtime. To enable this level of customization, we must shift from static to data-bound object properties, which allow Power BI to associate formatting settings dynamically with each data point in the visual.
Reference: GitHub - microsoft/powerbi-visuals-utils-formattingmodel: powerbi visuals formatting model helper ut...
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi @NileshBhayani ,
Thanks for reaching out to the Microsoft fabric community forum.
In the current setup, the capabilities.json file defines a single sliceColor property under the slices object, which applies uniformly rather than on a per-category basis. This structure lacks the flexibility to store and retrieve distinct formatting settings for each slice. As a result, while colour pickers may appear in the formatting pane, the visual cannot persist or retrieve category-specific colour selections at runtime. To enable this level of customization, we must shift from static to data-bound object properties, which allow Power BI to associate formatting settings dynamically with each data point in the visual.
Reference: GitHub - microsoft/powerbi-visuals-utils-formattingmodel: powerbi visuals formatting model helper ut...
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 45 | |
| 41 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 201 | |
| 126 | |
| 103 | |
| 72 | |
| 54 |