1 Reply Latest reply on Dec 20, 2018 3:35 PM by Patrick A Van Der Hyde

# Advanced Conditional Formatting/Calculated Field

Hi all,

I have attached a worksheet where I am having some trouble doing some conditional formatting.

There is a table here which is providing a breakdown of how client's customers vote on their websites. The clients can have one of two voting systems - either thumbs up/thumbs down or five stars. Statistically speaking - the big difference here is that thumbs up/down logs a vote of 0 (bad) / 1 (good) whereas the five stars has 1 and 2 as bad and 3-5 as good. So this means that 1 changes from good to bad depending on the voting type.

There are two columns in this table - % of Total Votes Increase/Decrease Mom (%) and Votes Difference MoM (%) - the calculations for these are already done and working (basically comparing MoM data for the percentage of totals and difference) - now what I want to do is color them in based on whether the difference is positive or negative. What this will look like is as follows:

Up/Down:

If the MoM difference has increased for 0 votes - Red

If the MoM difference has decreased for 0 votes - Green

If the MoM difference has increased for 1 votes - Green

If the MoM difference has decreased for 1 votes - Red

Else, if same/no change, then Yellow

1 - 5

If the MoM difference has increased for 1-2 votes - Red

If the MoM difference has decreased for 1-2 votes - Green

If the MoM difference has increased 3-5  votes - Green

If the MoM difference has decreased 3-5 1 votes - Red

Else, if same/no change, then Yellow

I do have one column colored in but it is wrong. That is there to show how the formatting could look.

My initial question is - how hard is it to do this type of formatting in Tableau?I have tried briefly to build a calculation that would look at the voting type first, and if the voting type equaled "Up/Down" then do this, else do this, but couldn't quite get it to work. How can I tackle this problem? What would be the best and easiest method?

Thanks once again for the help!

• ###### 1. Re: Advanced Conditional Formatting/Calculated Field

Hello Graeme,

There is a great example workbook for doing this that can be found here - Tableau Public

Thanks to Jonathan Drummey who provides clear steps to recreate the 'Axis of Many Colors' tab.  This workbook is a great reference for building KPI dashboards.

Patrick