This article explains how to provide different color schemes to each column in a table in Tableau.
There are situations when we want to apply different color coding schemes to each column of a table developed/created in Tableau. This article explains a very simple way to provide different colors in a single table.
When do we require different color schemes in the same table?
Different color schemes may be required in a single table when:
- There are multiple measures that are being shown in the table, and the values may give different meanings for different measures
- There are multiple measures that are being shown in the table, and each measure has different ranges specified for their values.
Different color coding in a table in Tableau:
Following is a detailed explanation of how to incorporate multiple color schemes in a single Tableau table.
First decide the measures for which color coding needs to be provided and create calculated fields specifying the colors for different values or values ranges.As an example, let us consider the ‘Discount’, ‘Sales’, ‘Quantity’ and ‘Profit’ measures are to be shown at a ‘Region-Category’ level. All data has been obtained from the ‘Sample – Superstore’ dataset.
For the above mentioned 4 metrics/measures, we need to create 4 different calculated fields with the color schemes, as shown below:
Create a dummy calculated field, say ‘Placeholder’, as shown below.
Now that all the required calculated fields are created, let’s start creating the table.
First, place the required dimensions, here Region and Category, on the Rows shelf. Then place the ‘Placeholder’ calculated field ‘N’ (= number of required measures, here 4) times, on the Columns shelf.
Open each of the tab (one for every pill on the Columns shelf) in the Marks shelf and do the following:
- Change the Mark type to ‘Text’
- Place the required measure on the ‘Label’ shelf
- Place the corresponding color calculated field on the ‘Color’ shelf
Right-click on the table and select ‘Format’. Click on the icon that looks like a pen. Change ‘Grid Lines’ and ‘Axis Ticks’ drop-downs to ‘None’.
Right-click on the axis of each measure and select ‘Edit Axis’ and do the following:
- In the ‘General’ tab, change the default title to the name of the measure that is shown in that particular column
- In the ‘Tick Marks’ tab, select the ‘None’ radio button for both ‘Major tick marks’ and ‘Minor tick marks’
The final touch-up is to be done, before the table is completely ready. Edit the axis height and change the fonts of the axes titles. Also, open the legends and modify them to give appropriate colors for the Color calculated fields.
The table with different color coding schemes for each column is ready!!
In order to bring the category names to the top of the table, instead of the bottom, place 4 (number of measures displayed in the table) additional ‘Placeholder’ pills on the Columns shelf, each one adjacent to an already existing pill. Then right-click on every second pill and select ‘Dual Axis’. Once the dual-axis chart is created, click on the axes on the top and select ‘Synchronize Axis’.
Follow steps 4 to 7 for the axes on the top. Don’t forget to edit the bottom axes and remove the title.