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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors