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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors