Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Conditional Formatting for Negative Numbers Bar Chart

I have a set of Revenue and EBITDA numbers for Customers. EBITDA can be negative sometimes. How can I still show it as positive but with a different color (red) than a positive EBITDA (black)? I was able to show it as positive value by using Absolute function but not sure how to run conditional formatting to make it look red? A3 is the customer with negative data. Here is:

  1. the data set on the right, 
  2. As is bar-chart in the middle
  3. Modified bar chart on the left with negative values shown as positive (only A3 here). But would like to make it red in color.

6 Replies

  • mike250's avatar
    mike250
    Frequent Visitor

    Liking the OP in support of wishing for this functionality.

  • Perkele's avatar
    Perkele
    Regular Visitor

    You can do it if you go into Visualizations->Format->Data Colors. 

    Then if you hover a mouse in the top-right corner you'll see 3 dots. If you click on those, you'll see a CONDITIONAL FORMATTING tab. There you can select different colors for negative and positive bars.

     

     

  • Hi, I saw this question today (I know its too late, but hoping it might help someone)

     

    I created 3 measures to solve this

    MEAS TOT PROFIT = SUM(Data[Profit])
    MEAS PROFIT ABS = IF([MEAS TOT PROFIT]<0, ABS([MEAS TOT PROFIT]), [MEAS TOT PROFIT])
    MEAS COLOR = ( IF(SUM(Data[Profit])<0, "RED","GREEN"))
     
    Then created a Bar chart with MEAS PROFIT ABS in X asis and then, under Format Visual, Bars, Colors, Default color, I clicked on fx (conditional formatting) and there I selected that MEAS COLOR. 
     

     

    I am sure there might be a more simpler way to solve this. But for now, this is what I could do in 2 mins. Hope it helps.