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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi everyone,
I’m hoping to get some ideas from the community.
As many of you know, when a visual uses a legend, Power BI doesn’t allow us to apply conditional formatting (from a table or measure) to control the column colors. I can apply conditional colors when there’s no legend.
I have multiple report pages, each containing several visuals, and manually adjusting the colors across all of them is becoming extremely time‑consuming.
Is there any way to apply conditional formatting to column colors while still using a legend?
Or, if that’s not possible, do you have any alternative approaches or best practices that could help make this easier to manage?
I’ve attached the Power BI file as well if anyone wants to take a look or experiment with it.
Thanks in advance for any suggestions.
Hi @0Experience,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @MFelix and @SamInogic for the prompt response.
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user's for the issue worked? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa
@v-achippa
No, the solutions provided unfortunately did not meet my expectations. Thank you for checking, though.
Hi,
In Microsoft Power BI, conditional formatting of column/bar colours only works when a Legend is not used. If you remove the legend, you can fully control the colours using a measure or rules.
Steps to Apply Conditional Formatting Without a Legend
Colour Measure =
SWITCH(
SELECTEDVALUE('Table'[Country]),
"Brazil", "#1f77b4",
"Germany", "#2ca02c",
"Japan", "#ff7f0e",
"USA", "#9467bd",
"#cccccc"
)
Choose:
This will dynamically apply colours to the bars based on your logic.
Additionally,
If you still want users to understand the categories without a legend, you can:
This approach allows you to maintain dynamic colour control while avoiding the limitation that occurs when a legend is present.
Hope this helps.
Thanks!
Hi @0Experience ,
The colors are set based on the theme so when you select a specific field the values will have the same color based on the order of the colors selected in this case you are using the base theme for Power BI so when you select the country it will apply the same color consistently to the 1st, 2nd, and so on.
The problem occurs when has you refer apply the legend and then the colors are repeated even when you select different column categories:
Depending on what type of visual you are using you can change this in order to get the condittional formatting.
For example in the case the you show you can make a concatenation of the x-axis instead of using the legend and in that case you can then use the condittional formatting using a table with the expected colors.
Check the video below:
https://www.youtube.com/watch?v=-FG0DSSAr60
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@MFelix thanks for your detailed reply and for the examples. Really appreciate it.
However, I don't want to use the concatenation of the x-axis
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 47 | |
| 29 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 88 | |
| 73 | |
| 39 | |
| 26 | |
| 24 |