Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All,
I want to create a 100% stacked bar chart that shows the progress per employee on target. I want the 'achieved' part of the bar to be colored, and the 'to-go' part in light gray.
However, the colored part of the bar should change based on the selected company. The issue is that the conditional formatting option for bar colors dissappears when you add multiple measures (or a bar legend) to the visual.
It's a nice to have and not a must for this case, but i'm still curious if anyone found a workaround for this.
Solved! Go to Solution.
The Power BI Desktop interface won't allow conditional formatting on any core stacked bar/column visuals when multiple measures or a legend field are included (as you've observed).
There is a "hack" which I've used in the past described in this post that involves editing the visual.json file within the PBIP format. I have tested this myself previously and it appears to work as expected, but it's not "officially" supported.
Hi @BBConsultancy,
Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
Please feel free to reach out Microsoft fabric community forum.
Thank you.
- Unpivot your data so you have a single measure (Value) and a category column (Status: "Achieved", "To Go").
- Use legend-based coloring: set "To Go" to light gray manually.
- For "Achieved", use a DAX measure to dynamically assign color based on selected company.
- Conditional formatting only works with fields, not multiple measures—so avoid using separate Achieved and To Go measures.
Hi, thanks for your reply. When you use just one measure and put status in the legend, you still don't have the option to apply conditional formatting.
Hi @BBConsultancy,
You’re right, adding a legend to a stacked column or bar chart disables the conditional formatting (fx) option for data colors. This is a known limitation in Power BI visuals.
As a workaround, you can use a dynamic color measure or a field parameter to control colors based on the selected company.
Alternatively, custom visuals like Deneb or Charticulator allow color assignment through measures or expressions. If you want to use only native visuals, you can create a lookup table that maps each company to a specific color and reference it in your measure to dynamically set the Achieved color, while keeping To Go in light gray. This helps maintain visual consistency even without native conditional formatting when a legend is present.
Thank you and continue using Microsoft Fabric Community Forum.
Ideally I would use native visuals only. I am not sure your options would work though as they'd still require the conditional formatting option being enabled. I'll give the solution from @OwenAuger a go. Thanks anyway!
The Power BI Desktop interface won't allow conditional formatting on any core stacked bar/column visuals when multiple measures or a legend field are included (as you've observed).
There is a "hack" which I've used in the past described in this post that involves editing the visual.json file within the PBIP format. I have tested this myself previously and it appears to work as expected, but it's not "officially" supported.
Hello Owen,
did you manage to use a measure for bar charts in stacked bar chart with legend?
How did you do this? It would be exteremely helpful.
Best,
Jacek
I tested it already. Unfortunately, it is not possible, Power BI UI still after implementing hack is not allowing to have conditional formatting...
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.