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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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