This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I created a custom visual in power BI that allowed to insert different types of chart in one plot. But when I insert the plot on the dashboard, I have some trouble with date slicer. I define a colour for ma data and I save it with:
let view = dataView[0].categorical;
let categories = view.categories[0];
let objects = categories.objects;
let value = view.values;
for (let i = 0, len = Math.max(value.length); i < len; i++) {
viewModel.dataPoints.push({
category: <string>value[i].source.displayName,
colour: objects && objects[i] && DataViewObjects.getFillColor(objects[i], {
objectName: "colorSelector",
propertyName: "fill"
}, null),
selectionId: this.host.createSelectionIdBuilder()
.withCategory(categories, i)
.createSelectionId(),
});
}But when I change the date slicer, objects is null or undefined and colour is reset to default.
There is a solution to always save the color in object when slicer is modify.
Thanks for yours help.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 3 | |
| 3 | |
| 2 |