Conditional Coloring by Comparing Values in Multiple Columns


In previous posts, we have discussed the use of conditional coloring to color based off rules such as greater than, less than, top, and bottom. In this post, we will discuss how to apply conditional coloring when comparing values in multiple columns.


Let's assume we have data about particular projects (although it could be data on anything). In this data table, we have columns for the "Planned Start Date" and the "Actual Start Date".

 

 
Suppose we want to conditionally color all values in the "Actual Start Date" column where the "Actual Start Date" is less past the "Planned Start Date"?  For this, we should first add a Color scheme grouping in our table visualization which includes the column we want to conditionally color on. In this case, it's the "Actual Start Date" column.


We should then add a Coloring rule, with the Rule type being set to 'Boolean expression'

 

For the value of the rule, we will enter a custom expression. In this expression we will check if the "Planned Start Date" value is less than the "Actual Start Date" value.
 



This expression is evaluated for each active row in the data table.  If the expression returns true, the "Actual Start Date" cell in that row will be colored.