Conditional Formatting in Tableau
We’ve always liked to use colors in our visualizations!
Last week, we wanted to show year on year percent changes for several metrics / dimensions.
We could easily change the label colors to be Red, Yellow and Green. But we couldn’t add the color as a background and highlight it, until we learned this cool new trick to add custom conditional formatting in Tableau:
Create a table with the dimensions you want to compare in time
A- Create a quick table calculation “percent change” to measure the YoY change
B- Hide any periods if necessary
A- Create a new calculated field called ONE
B- The formula for this field will just be 1… yes, that easy!
A- Drag this new ONE field to the column field
B- Edit the axis and limit the range, from 0 to 1
C- Resize your work
A- Drag the measures to the detail
B- Create again a new calculation (same as last time) to add the percent change from the previous period
C- Now drag this to the color marks and change colors as needed
Category: White Peak