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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Joe_0365
Frequent Visitor

change bar chart column color based on values

I wanted to show columns in the picture different color based on their values. 

Those bars are various measures, in this case, they are YTD unit sales vs last year, Latest perod unit sales change and last week unit sales change, I want them to show green if they are positive or red if negative.  Can not find fx button that usually showing next to color settings, can anyone help me? thank you. 

columnscolumnsbar color settings menubar color settings menu

1 ACCEPTED SOLUTION
olgad
Super User
Super User

Look at this example, but there i have only one metric VTB, i make two out of that, you can see the formula for negative the same for positive. 

In this case I had to change the visual type as well.

olgad_0-1676365542140.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

4 REPLIES 4
olgad
Super User
Super User

Look at this example, but there i have only one metric VTB, i make two out of that, you can see the formula for negative the same for positive. 

In this case I had to change the visual type as well.

olgad_0-1676365542140.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Thank you, you helped me alot!

olgad
Super User
Super User

Hi, you can have the following workaround:

Measure 1=If( Ytd unit sales change>0, Ytd unit sales change)

Measure 2 =  If( Ytd unit sales change< 0, Ytd unit sales change)

then you can pick color for all above -green, for all the measures below -red.


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hello, Olgad, thanks. I am new to PBI. not quite sure how to follow your solution. 

 

Based on what you said, I am guessing I will have to create 6 meausres, 2 for each. that should be fine.

 

Can you give some more details on how to put measure 1 and measure 2 into correct place? Thanks again! 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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