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!View all the Fabric Data Days sessions on demand. View schedule
In the graph above, each element of the Y-axis belongs to a category (sometimes several elements belong to the same category).
I would like to set the bar colors in a way that we see what group of elements belong to the same category.
For example: if 3 elements belong to the same category, their bars are going to be the same color.
How do I do that?
And if I can't do that, is there another kind of graph that allows me to do that?
Solved! Go to Solution.
Hi @MrPontes
Please see attached PBIX file for solution.
I'm using this subset of your data and have added a column to represent the category that determines the bar color.
You need to create a measure like this
Category Color = SWITCH(
TRUE(),
MIN('Table'[Category]) = "A", "red",
MIN('Table'[Category]) = "B", "green",
MIN('Table'[Category]) = "C", "blue",
"black"
)
Then with Name on the Axis and Value in Values, click on Format -> data colors and then on the fx icon to create a formatting rule
Format by : Field value and Based on Field : Category Color (the new measure we just created)
To give this
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @MrPontes
Please see attached PBIX file for solution.
I'm using this subset of your data and have added a column to represent the category that determines the bar color.
You need to create a measure like this
Category Color = SWITCH(
TRUE(),
MIN('Table'[Category]) = "A", "red",
MIN('Table'[Category]) = "B", "green",
MIN('Table'[Category]) = "C", "blue",
"black"
)
Then with Name on the Axis and Value in Values, click on Format -> data colors and then on the fx icon to create a formatting rule
Format by : Field value and Based on Field : Category Color (the new measure we just created)
To give this
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!