How to Create a Gradient Bar Chart in Tableau with Different Colors Above and Below Average

Tableau provides various opportunities and visualization options to solve almost any complex need. The ability to comprehend lot of data in a short span of time with interactive and color-coded visuals has been a hallmark of fascinating Tableau visualizations. As the newer versions of the product are released we continue to be amazed at how many features that were unimaginable in the earliest versions are now a breeze.

One particular scenario that is often useful is to highlight whether a measure like Sales is greater or lesser and by how much with reference to the Sales of a broader or higher reference criterion. For example I might want to see how much the Average Sales of California compares to the National Sales Average for each of the Product Sub-Categories. This can be achieved like below, note how the Reference Line and National average bar stays static as we change the filters. The filters only change the dynamic part, this can be achieved using Level of Detail calculations.