9 Replies Latest reply on Jun 22, 2018 1:11 PM by Andres Aleson

# How to conditional color just the grand total and subtotals

Hi,

I have a requirement for conditional coloring the total based on the value. Is it possible to just add colors to total and subtotals?

Thanks,

Lavy

• ###### 1. Re: How to conditional color just the grand total and subtotals

Hi Lavanya,

If you are looking for this thing, thn check screenshot and attached in 10.2.

Hope it Helps!!!

Thanks

Deepak

• ###### 2. Re: How to conditional color just the grand total and subtotals

Thanks Deepak, this is what I'm looking for. Can you please explain how the calculation1 works?

• ###### 3. Re: How to conditional color just the grand total and subtotals

Hi

I tried another approach based on Deepak's data.  Thank you Deepak.

// else very small number which doe not impact "total" color.  last(0)=first() represents subtotal/total

[Sum sales for Color]

if last()=first() then sum([Sales]) else -100000 end

Result

Thanks,

Shin

2 of 2 people found this helpful
• ###### 4. Re: How to conditional color just the grand total and subtotals

Thanks Deepak. Finally it worked for me

• ###### 5. Re: How to conditional color just the grand total and subtotals

Thats an other way to do. Thanks Shin for the suggeston.

• ###### 6. Re: How to conditional color just the grand total and subtotals

Hi Lavanya,

Glad it worked!!! I just built the logic upon Creating the Individual Sum across segment and category using Calculation 2 and then I compared this aggregation against the Fixed Aggregation for the same through Calculation 1 to compare and wherever it matched, there is no Color and where it matched, it would be colored. Changed the color for "No color" to White and dragged Number of records set it to MIN in the Size.

Check Screenshot :

Thanks!!!

Deepak

• ###### 7. Re: How to conditional color just the grand total and subtotals

Hi Deepak,

One quick question about highlighting the total. The above calculation worked if I have a single measure. But If I try to apply it across more than one measure, the color doesn't work.

For example, in the below scenario I want only Total >1 to be red and others to be Amber.

1 of 1 people found this helpful
• ###### 8. Re: How to conditional color just the grand total and subtotals

All the solutions in this thread is awesome while I have similar question as Lavanya.

Can we condition the color on both the row level numbers and the total /subtotal number Seperately

For example  for each row level, we want to have the number less than 0 as red; we want to the number more than 0 as green.

for the subtotal For the number

more than one threshold ???( maybe 5000) we want to dark blue

less than threshold ???(maybe 5000), we get light blue

• ###### 9. Re: How to conditional color just the grand total and subtotals

Hi Deepak,

I have an older version of tableau with work, and can't open your file. Could you reply pasting the text within the table calculation for "Calculation 1". Would really appreciate it.

Thanks,

Andres