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
Hi Guys,
I have customized teams and have colors like here:
I have one page with chart like here:
and this is based on subscription Name, as you cn see the biggest is orange color.
When I am coming to different page I have this chart:
It is based Resource Type.
But as you can see colors are switched. Orange is the last color, not first. Why?
Why power bi doing this automatically?
How to avoid this? Manually going through all visuals and setting colors manually can be painful...
Best,
Jacek
Hi @jaryszek,
Please create a measure to apply conditional formatting for each category. If you have any additional questions, feel free to let us know.
Thank you.
Hi @jaryszek,
Thank you @Ritaf1983 @AmiraBedh @DataNinja777, for your insights.
Power BI assigns theme colors to visuals based on the order of categories, which means colors may look different if the sorting changes. To resolve this, you can create a DAX measure that assigns specific HEX colors to each category and use conditional formatting with the Field value option to apply it.
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
Thank you.
Hi @jaryszek,
Have you had a chance to review the solution we shared by @Ritaf1983 @AmiraBedh @DataNinja777? If the issue persists, feel free to reply so we can help further.
Thank you.
Nope,
This is my question asked to @DataNinja777 :
this would be nice but what if top categories will change in different time range for example?
And what If from 100 Subscription Names I will have different top 5?
Best,
Jacek
Hi @jaryszek,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
Nope it is not.
There is nothing for now...just workarounds and not robust besides @Ritaf1983 answer...But this is changing a visual entirel (try to convince my boss :))
🙂
Just show him both versions and ask questions about the trends comparison.
This method works in 90% + of cases .
Good luck!
Of course i will do this!
But still maybe there is a some magician way to make a workaround for the topic case 😉
Hi @jaryszek,
As recommended by the @Ritaf1983, this is the best workaround proposed as off now.
Thank you.
We will see.
Hi @jaryszek,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
Yes I still need asistance, please keep this topic opened.
Hi @jaryszek,
Thank you for your response. We will keep this thread open for any further updates or discussions.
Thank you.
Hו @jaryszek
The theme is applied consistently, but visuals interpret the “first” category differently. In a donut, the first category in the list gets Color 1, Color 2, etc. In an area chart, the series drawn closest to zero is treated as “last” so the colors may look inconsistent across pages.
If you want to avoid this confusion, consider using small multiples instead of stacked area charts. That way, each category is shown in its own panel, and users don’t need to decode which color represents which category. This also prevents cases where the same color seems to mean different things across the dashboard.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hello !
Thank you for posting on Fabric community.
Power BI isn’t switching your colors since each visual assigns colors in palette order to the series order of that visual legend and because your 2 pages use different category fields and different sort so the first series in one visual isn’t the same item as the first series in the other so the orange ends up on a different category.
You can create a measure that returns the HEX color for the current category and use it in your chart in the data color as field value in the format style.
Hi @jaryszek ,
This is a common behavior in Power BI, and the reason your colors are switched is that Power BI applies your theme's colors sequentially based on the sort order of the categories within each specific chart. Your donut chart is sorted by the highest value, so the largest slice, CCHBC-SAP-Prod-QA, correctly gets the first color from your theme (orange). In contrast, your area chart's legend is likely sorted alphabetically by the ResourceType name. This means the first name in the alphabet, microsoft.avs, gets that same first color from the theme, even though it's not the largest value.
To fix this permanently and avoid manually changing colors on every visual, the most robust solution is to create a DAX measure that assigns a specific color hex code to a specific category name. This ensures a category always receives the same color, regardless of how any chart is sorted. You will need to create a new measure for each field you want to control. For your SubscriptionName field, you can create a new measure using a DAX formula like the one below. Be sure to replace the placeholder table and column names with your own and use the exact hex color codes from your custom theme.
Subscription Color =
SWITCH(
TRUE(),
SELECTEDVALUE('YourTable'[SubscriptionName]) = "CCHBC-SAP-Prod-QA", "#FFC000",
SELECTEDVALUE('YourTable'[SubscriptionName]) = "CCHBC Dat...", "#008080",
SELECTEDVALUE('YourTable'[SubscriptionName]) = "CCHBC Az...", "#4169E1",
"#808080"
)
After creating the measure, select your donut chart and navigate to the "Format your visual" pane. Expand the "Slices" section and click the conditional formatting fx button next to the "Color" property. In the window that opens, set the "Format style" to "Field value" and then select your new Subscription Color measure as the field to base the color on. Once you click OK, the colors will be applied based on your DAX logic. You can then repeat this process by creating a similar DAX measure for the ResourceType field and applying it to your area chart to ensure all your visuals are perfectly consistent.
Best regards,
thank you very much,
this would be nice but what if top categories will change in different time range for example?
And what If from 100 Subscription Names I will have different top 5?
Best,
Jacek
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |