Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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.
Solved! Go to Solution.
Hi @0Experience
Thank you for the thorough explanation. Currently, in Power BI, when a visual uses a legend for multiple series, the legend determines the color assignment for each series. As a result, conditional formatting for data colors using DAX measures or field values may not be available, as it is overridden by the legend.
See this reference: https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-conditional-formatting#co…
For cases where you need consistent colors across visuals and pages, using a Report Theme (JSON) is recommended. This approach centralizes the color palette and helps maintain consistency, though colors are assigned based on the series order and may change if legend values are filtered.
If you need fully dynamic, data-driven color control while keeping the legend (including in Focus Mode and exports), native Power BI visuals do not currently support this. In such situations, a custom visual like Deneb can be used to explicitly map colors and retain a functional legend.
Reference:https://learn.microsoft.com/en-us/power-bi/create-reports/report-themes-create-custom
If you have any further questions, feel free to reach out and we'll be glad to assist.
Regards,
Microsoft Fabric Community Support Team.
Hi @0Experience
Just checking in as we haven't received a response to our previous message. Were you able to review the information above? Let us know if you have any additional questions.
Thank You.
Hi @0Experience
Could you please mark the answer as verified if it meets your expectations? Once it is marked as verified, this forum thread can be closed.
Hi @0Experience ,
One question to try and give you some work around, I believe that your example is not matching your model setup, when youn refer that you want to keep consitency across the pages is it fpor a particular dimension, or is it for all the calculations?
Do you have a lot of values on your dimension table that you are using for legend or are only a few values?
Can you please elaborate a little bit more on your semantic model setup and expected outcome.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@MFelix thank you again.
I have a total of 11 countries in my legend, and they are all connected to a filter/slicer. When I use the countries in the legend, Power BI automatically assigns colors to them, but I don’t want to use those default colors. I need to apply specific colors, which I am currently setting manually. Since my report has 20 pages and each page contains around 15 visuals, manually adjusting colors is extremely time‑consuming and not a good practice.
My goal is to assign colors from a DAX/table instead. However, if I remove Country from the legend, then I can apply the colors from the DAX/table, but I lose the legend entirely. As a workaround, I could place a separate visual on each page to display the country colors as a legend, but this approach has a limitation: when users switch a visual into Focus Mode or take a screenshot, the separate legend visual will not appear.
Additionally, the X‑axis varies across visuals. For example, some visuals use Gender (male, female, non‑binary), while others use Area Type (urban, rural). The number of X‑axis categories changes from one visual to another, sometimes as few as 2 and sometimes up to 20.
Hi @0Experience
Thank you for the thorough explanation. Currently, in Power BI, when a visual uses a legend for multiple series, the legend determines the color assignment for each series. As a result, conditional formatting for data colors using DAX measures or field values may not be available, as it is overridden by the legend.
See this reference: https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-conditional-formatting#co…
For cases where you need consistent colors across visuals and pages, using a Report Theme (JSON) is recommended. This approach centralizes the color palette and helps maintain consistency, though colors are assigned based on the series order and may change if legend values are filtered.
If you need fully dynamic, data-driven color control while keeping the legend (including in Focus Mode and exports), native Power BI visuals do not currently support this. In such situations, a custom visual like Deneb can be used to explicitly map colors and retain a functional legend.
Reference:https://learn.microsoft.com/en-us/power-bi/create-reports/report-themes-create-custom
If you have any further questions, feel free to reach out and we'll be glad to assist.
Regards,
Microsoft Fabric Community Support Team.
@Ryan_Pat I am still looking for an answer because the previous responses did not meet my expectations. I’m also not sure whether the problem I have or the solution I’m seeking is actually feasible or possible.
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!
@SamInogic thanks for your answer.
I can’t use a separate legend visual or text explanation in the report because, when a user switches to focus mode or takes a screenshot, that separate legend/explanation will not appear in the screenshot.
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
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |