5 Replies Latest reply on Nov 11, 2018 11:31 AM by Ralf Rattay

# Map Visualisation: Different color when equal values

Hi there,

I'm visualising the revenues of two sales teams on a map. Let's say, it's team blue and team red. The sales team with the most revenues gets the postal code, e.g. team blue wins, than the postal codes get blue. So far, so good. But sometimes, both teams have the same revenues. Then, tableau is shaping the postal code with a combination of both colors. Still, this is confusing, since it looks more like a blue than a red. Is it possible that I can define a third, neutral color when the revenues are equal?

Ralf

• ###### 1. Re: Map Visualisation: Different color when equal values

Any chance you can share a sample workbook? Without that, it's really difficult to answer this because we're not sure how you're controlling the color.

Without the workbook, then I'd say you could do something in a calculated field. Something like:

IF [Blue Sales] > [Red Sales] THEN

"Red"

ELSEIF [Red Sales] > [Blue Sales] THEN

"Blue"

ELSE

"Tie"

END

Of course, this would only count exact matches as ties. You may want to count things that are very close to a tie, so some rounding could take care of that.

1 of 1 people found this helpful
• ###### 2. Re: Map Visualisation: Different color when equal values

Hi Ken,

Kind regards,

Ralf

• ###### 3. Re: Map Visualisation: Different color when equal values

Tableau is actually plotting both blue and red on that mark. I'd suggest that you create measures for each team's revenues, like this:

Revenues Blue

// Revenue by postal code for the blue team only.

{FIXED [Postal Code]: SUM(IF [Team]="Blue" THEN [Revenues] END)}

Revenues Red

// Revenue by postal code for the red team only.

{FIXED [Postal Code]: SUM(IF [Team]="Red" THEN [Revenues] END)}

Then you can do a calculated field like the one I showed before:

Color

// Set the color based on which team has the highest revenue.

IF [Revenues Blue]>[Revenues Red] THEN

"Blue"

ELSEIF [Revenues Red]>[Revenues Blue] THEN

"Red"

ELSE

"Tie"

END

Then you can drop Color on the color card, then set the colors (be sure to remove Team from the detail card as well).

See attached.

1 of 1 people found this helpful
• ###### 4. Re: Map Visualisation: Different color when equal values

One other suggestion. You could create what's called a Predominance Map, which will show different shades of Red and Blue depending how much the team "won" by. For more details, see  https://community.tableau.com/message/834500#834500

• ###### 5. Re: Map Visualisation: Different color when equal values

Thank you so much Ken, that's working fine :-)))