9 Replies Latest reply on Dec 22, 2018 5:18 PM by Dave McManus

# Tableau conditional formatting (per column) but separately per dimension category

Now, it was difficult for me to find a proper tittle for this, but what I want to do is:

I have two dimension variables (Group 1 and Subgrup) and - in this example - two measures that I format conditionally. Now both of these measures are formatted all the way from top to bottom. What I wanted to achieve is to format these per Group 1 category, so Group 1 - A would have separate range, group B would have separate range, etc. So if a2has a value of '1' it will be red, then if in group B the lowest would be '120' it would be red also (coz right now its green as it's a high value among all).

• ###### 1. Re: Tableau conditional formatting (per column) but separately per dimension category

Sounds like a Table Calc might help here -- how familiar/skilled with Table Calculations are you?

Basically, you'd need to operate your calc within the pane, using some sort of WINDOW_ function, but that can get tricky if you're not sure what I'm talking about:

• ###### 2. Re: Tableau conditional formatting (per column) but separately per dimension category

Hi,

Different ways to do this. Here is my approach based on pivot.

Create a calculated field to color.

Place this to color. You can make it continuous to get a sequential color range.

Let me know if that helps or not.

~Tushar

• ###### 3. Re: Tableau conditional formatting (per column) but separately per dimension category

As I'm not sure if I was understood correctly (probably partially), that's why i constructed this awesome excel example of what I mean:

Measure1 conditional formatting is what I have now

Measure3 to the right is what I want to achieve

So I want to use conditional formatting (not discrete!) dividing it per GROUP or any other category I might have. so this formatting is set separately for group A, B and C.

In example Measure1 you can see that it's just one conditional formatting and number 1 has most red color, number 75 has most green color.

In Measure3 example this is different. For group A number 1 is red, 60 is green, but in group B, as the lowest nubmer is 50 - this number is red, and 52 as a max - is green.

PS - i cant use pivot tables and I must have this dynamic, not choosing colors for each number separately

• ###### 4. Re: Tableau conditional formatting (per column) but separately per dimension category

Like this?

1 of 1 people found this helpful
• ###### 5. Re: Tableau conditional formatting (per column) but separately per dimension category

Wow, this really is a workaround haha..

It works! Thanks. One more question - how to change values to percentage while they are a text value?

• ###### 6. Re: Tableau conditional formatting (per column) but separately per dimension category

Glad I could make it work

What exactly do you mean, change to percentage while they are text?

Do you mean tableau reads it as text (ABC) from your datasource?

Or do you want to show it as percent of total?

Or...?

• ###### 7. Re: Tableau conditional formatting (per column) but separately per dimension category

I have few metrics, lets say one is Clicks and one some kind of aggregation like clicks / impressions, so I wanna show the second metric as a % format and not numeric

• ###### 8. Re: Tableau conditional formatting (per column) but separately per dimension category

If you do the calculation in a calculated field you can simply change the default number format to show it in %

-->

If you do the calculation in the view do a right click on the number and choose format, then in Fields your calculation and in numbers you can change it to %.

-->

• ###### 9. Re: Tableau conditional formatting (per column) but separately per dimension category

hi Everyone - is there anyway to make the shading of my categories different? I'm trying to have each category have a different color - but when I change the shading it applies to the entire column.

End result I want is like the below: