Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color code only one column in tableau

I would like to color code the last column "difference in ratio", red if less than -10%, green if above 0%. Right now, it color codes the entire the data. How can I limit to only the last column? I attached the link to the file for your review.

Thank you!

https://drive.google.com/file/d/0B1PGq-fzDlKcWEpSdEhQX3VzajA/view?usp=sharing

like image 882
John Avatar asked Dec 14 '22 09:12

John


2 Answers

Using v10.4.2.

I used the "Legends Per Measure" function with a slight tweak.

I started by dragging my "Measure Values" to the "Color" box in the "Marks" area, and selecting "Use Separate Legends" from the right-click menu.

I then dragged another instance of "Measure Values" to the "Label" box in the "Marks" area.

I then created placeholder measure (use something like "=0" or "Min(0)" in the formula)

I dragged the placeholder measure to the "Size" box in the "Marks" area.

I then set all the Marks to "Bar". This is important for getting the background-coloring part to work

This is what your "marked-up" columns should look like, give or take:Final Marks Result

The magic, however, comes from editing your legends. I had three columns, three measures, thus, three legends.

I then selected the drop-down box in the first two legends and created a "Custom Diverging" legend for each one, and set the "Stepped Color" to 2, and then set both colors to white (#ffffff). See screenshot here: Legend Editing Screenshot

And voila: blank backgrounds for the unimportant columns.

This resulted in having no-fill background colors for the cells in the first two columns, and a conditional red-green background range (which I subsequently created) for the values in the third column. Apologies for all the blackout, as the information is confidential, but you should still be able to get the gist of the results: Final Result Screenshot

Hope this is all helpful! Enjoy.

like image 65
Moises del Real Avatar answered Jan 06 '23 08:01

Moises del Real


Follow the below steps :

  1. Remove your current calculation from Color Marks.
  2. Press CTRL + Measure Names + Color Flag and drag to Color Marks .It will Look Something as below.

enter image description here

  1. Color code as below , it will scale to whatever you wish because of discrete Color Flag .

enter image description here

Hope this answers. Let me know.

like image 27
minatverma Avatar answered Jan 06 '23 08:01

minatverma