4 Replies Latest reply on Mar 28, 2016 2:01 PM by David Guzman

# Color Coding Bar Graphs

Hi All,

I am currently trying to work with bar graphs to illustrate key identifiers in data. I want to construct a measure that would color code each individual bar graph depending on conditions. For this example, I want to color code the lowest value of each product sale with red and the highest sales number of each product with green. I would also want to color code the intermediate value bars with any color of my choosing.

I have tried using the Rank function and drag it into the color scheme, but it produces an intermediate color that I cannot change.

I have also looked at other forum, but their color scales use numeric values, while I would like to use the Max and Min.

I was wondering if anyone can help m with this matter. I feel like the solution is simple and I am just using the Min and Max function incorrectly.

Thanks.

• ###### 1. Re: Color Coding Bar Graphs

File doesn't open for me, is it possible for you to save it in 9.1 version?

• ###### 2. Re: Color Coding Bar Graphs

Sure, attached is a 9.0 Version on the workbook. Please let me know if you can not see it.

• ###### 3. Re: Color Coding Bar Graphs

David - I did use Rank() to get the desired o/p. Hopefully this helps you!

I am using Red for min (sales), green for Max(sales) and Yellow for intermediate, however, if you want to 2 different colors for intermediate then you can do that too with a slight change in the logic.

In color bucket field add this condition

ELSEif [Rank]=3 then "Yellow"

elseif [Rank]=2 then "Blue"

• ###### 4. Re: Color Coding Bar Graphs

Thank you for your help. This is definitely the best approach if we have a fixed number of products on the dashboard. (here being 4 products).

I want to take it a step further if you don't mind. What if a new product enters the data through a live update. Having this metric defined by static numbers would force the user to make modifications to the "Color Bucket." I would like to construct a measure that calculates the most sales (show it as green) and least sales (show it as red) and have the intermediate bars to be a color of my choosing (example: Blue).

I modified your dashboard to show what I mean. The parameter signifies the month of the dashboard and present the data that would have been available at that time.

I have attached the dashboard with the parameter. As you can see, the measure would not present the correct color scheme. I would like to make this measure as dynamic as possible.

Sorry for the additional question, but I have been extremely curious in finding solutions for all possible visualizations scenarios for this dashboard.

Thanks again.