Google Data Studio Variance chart (positive and negative numbers different colour)

Viewed 1175

Does anyone know how to make a variance chart with green positive bars and red negative bars. Seems like a basic task to invert colours for negative values but I can't find how to do it.

Thanks

Example Variance chart from Excel

1 Answers

One way that it can be achieved in a Bar Chart is by using the two IF functions below instead of a single field, in the Metric section (where the name of the respective field is Metric), and in the Style Tab, setting the bar colour of Positive to Green and Negative to Red then ticking Stacked Bars:

1) Positive (Colour: Green)

IF(Metric >= 0, Metric, NULL)

2) Negative (Red: Red)

IF(Metric >= 0, NULL, Metric)

Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:

Related