In this article under tableau tips we would see how to do conditional formatting in Tableau the similar way we do in excel.
We would be using our same data source for this : Sample Superstore data.
To get started first lets create the text table that we would like to format.
To do this drag Subcategories to the Rows and Region to the columns. Bring the measure profit ratio onto the marks card. Your view will now be the following:
Here we see the profit ratio for the subcategories displayed across region in the form of a crosstab. Now lets say we want to color the cells as under : Red denoting low profit for Profit percentage value less than 0 , Yellow denoting medium profit for Profit percentage between 0 an 25% and Green denoting profit percentage more than 25%.
To do this we create a calculated field for classifying the profits as under :
Once created drag this measure to the colors mark and choose the colors accordingly.
Click on the marks card and change it to Bar from automatic. Your worksheet will now look like this:
Create a calculated field Min(1) as under :
Drag this to the size on the Marks and you will have your text table formatted according to the condition.
Hope you guys enjoyed it.