7 Replies Latest reply on Aug 6, 2018 4:54 AM by eva_lesny

# Combining two measures into a single color legend

Hello Tableau Community,

I have done a pie chart with two measures into a single color, but I would like in the legend display only one of the measures "Tipo". How  could I prefome that?

I send you a picture with my pie chart, I would like the measure "Sexo"(hombres,mujeres) stay hide, and only be shown the measure "Tipo". I mark the leyend that I would like to performe in red

• ###### 1. Re: Combining two measures into a single color legend

Hi, you can select those blue colors then group them >>

Rename Legend to Hombres

• ###### 2. Re: Combining two measures into a single color legend

Hi Claudia,

I can't see the measure 'Tipo' on the viz at all, so I'm not sure of your requirements. If the grouping solution that Joy posted above doesn't work for you can you explain this in more detail or more preferably can you post a .twbx example showing where you have gotten up to, and the logic that you have followed ?

HTH

Peter

• ###### 3. Re: Combining two measures into a single color legend

Could you please explain to me how to do that? I dont want to change my graph only the legend like that:

Thank you very much!

• ###### 4. Re: Combining two measures into a single color legend

Hi Claudia,

To achieve the above scenario, You can "custom split" the column "Tipo"  with "," as separator and

use the "Tipo -Split 2" column on you color mark.

• ###### 5. Re: Combining two measures into a single color legend

Because you are using two measures on the color shelf you need to "cheat" a little bit.

Create a calculated field:

if [Sexo] = 'hombres' then [Tipo] else [Tipo]+' women' end

Use this field on colour, adjust the colours as wanted, then change this calculated field again to

if [Sexo] = 'hombres' then [Tipo] else [Tipo]+' ' end

That space in the end is added so that Tableau can distinguish between the two values.

And that first step is needed so that you can correctly colour your graph.

1 of 1 people found this helpful
• ###### 6. Re: Combining two measures into a single color legend

Thank you all of you for your help!

I have done just what i Want! I used the solution of Eva, You are the best!