Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Change chart X axis formatting with measure

 
Hi all

 

I am trying to change some of the data to colour 1 and other to colour 2 with measure

 
Bar color =
SWITCHTRUE(),
    CONTAINSSTRINGSELECTEDVALUE'Data'[PLACE] ), "EUROPE" ), "Red",
    CONTAINSSTRINGSELECTEDVALUE'Data'[PLACE] ), "AMERICA" ), "Green",
   BLANK()
   )
 
when used on columns it is working just fine, but when applied to x axis values nothing is changing
2 REPLIES 2
Anonymous
Not applicable

Hi!

 

I would not like to color the bar, but I would like to color the x axis text by grop, for example if the city is in Europe color would be Red and if in America then Green

Is that possible?

andhiii079845
Solution Sage
Solution Sage

You can use the condtional formatting to change the bar chart. 
https://blog.enterprisedna.co/power-bi-conditional-formatting-for-chart-visuals-whats-possible/

 

You can also generate with the the dax code the color of the bar chart. 
https://community.fabric.microsoft.com/t5/Desktop/Conditional-format-of-bar-chart-based-on-a-table-w...





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.