KNOWLEDGE BASE

How To Assign Different Colors In Measures In Cross Table


Published: 03 Jun 2020
Last Modified Date: 04 Jun 2020

Question

How to use different logic of color for each measure in cross table

For example, want to color Sales by Region and color Profit by Category

Before:
[image]
User-added image
After:
[image]
User-added image
 

Environment

  • Tableau Desktop

Answer

1.Drag Category to Columns and Region to Rows

2.Double click on Columns and enter 0

3.Double click on Columns and enter AVG(1)

4.Repeat step 2 and 3

5.Right click on the first SUM(0) and click on Dual Axis

6.Right click on the second SUM(0) and click on Dual Axis

7.Change mark type of All to Bar

8.Remove Measure Names on Color from All mark card

9.Click on Color of first SUM(o) mark card and change the Opacity to 0%

10.Drag Sales to Label of first AVG(1) mark card

11.Drag Region to Color of first AVG(1) mark card and Edit Color

12.Drag Number of Records with right click to Size of first AVG(1) mark card and choose Average

13.Click on Label of first AVG(1) mark card and change Horizontal Alignment to Right

14.Click on Color of second SUM(o) mark card and change the Opacity to 0%

15.Drag Profit to Label of second AVG(1) mark card

16.Drag Category to Color of second AVG(1)mark card and Edit Color

17.Drag Number of Records with right click to Size of second AVG(1) mark card and choose Average

18.Click on Label of second AVG(1) mark card and change Horizontal Alignment to Right

19.Right click on first AVG(1) axis and click Edit Axis, setting as bellow

-General:

+Range:Fixed
  Fixed Start: 0
  Fixed End: 1

+Title:Sales

-Tick Marks:

+Major Tick Marks: None
+Minor Tick Marks: None

20.Right click on second AVG(1) axis and click Edit Axis, setting as bellow

-General:

+Range:Fixed
  Fixed Start: 0
  Fixed End: 1

+Title:profit

-Tick Marks:

+Major Tick Marks: None
+Minor Tick Marks: None

21. Right click on first 0 axis and click Edit Axis, setting as bellow

-General:

+Title: (blank)

-Tick Marks:

+Major Tick Marks: None
+Minor Tick Marks: None

22. Right click on second 0 axis and click Edit Axis, setting as bellow

-General:

+Title: (blank)

-Tick Marks:

+Major Tick Marks: None
+Minor Tick Marks: None

23. Click on Format -> Lines -> Columns and set Grid Lines as well as Zero Lines to none
 
Did this article resolve the issue?