5 Replies Latest reply on Dec 7, 2012 11:17 AM by Alex Kerin

Coloring a bar chart by a KPI Ratio

I am trying to color a bar chart by a KPI but in a way I have not been able to find an answer to.   My user wants to see the bar change as it goes into different points of the KPI.  Like the firt 90% will be blue then the next 15% will be green and the next 15% will be yellow and anything above that will be red.   He does not what the whole bar to change color but instead to see the different levels with in the bar as it shows how we are doing against the KPI ratio. IS ths possible with Tableau and if so can some one help me figure this out.

Thank you,

• 1. Re: Coloring a bar chart by a KPI Ratio

Answered last week - have fun....

http://community.tableau.com/message/192916#192916

• 2. Re: Coloring a bar chart by a KPI Ratio

Alex,

I can make it work using a constant value but how can you do it using the Profit ratio?  What I need to do it base it on the a ratio of budget/sales like he is doing in the profit ratio but he is using profit/sales.   I then need to use that to detemind the amount of the different break downs on a daily basis.   It will change everyday so I can not use a constant to do this.

• 3. Re: Coloring a bar chart by a KPI Ratio

What will the change be based on? Will it always be less than 90% for one of the bars for example. Can you mock up what you would expect?

• 4. Re: Coloring a bar chart by a KPI Ratio

Alex,

I have done it with a KPI on the color shelf but it changes the whole line.   I wan tthe line color to change as it goes up.  This is the code of my KPI:

IF [Sales Amount]/[Budget Sales] > 1.1500 then 'More than 115% of Budget'

ELSEIF [Sales Amount]/[Budget Sales] > .9400 then '94% - 115% of Budget'

ELSEIF [Sales Amount]/[Budget Sales] > .8400 then '84% - 94% of Budget'

else ' 0 to 84% of Budget'

end

and I have attached the image of what I am getting when I do this.

• 5. Re: Coloring a bar chart by a KPI Ratio

I don't really see how this is different from the original equation - break it into sep measures depending on the break points