Tableau Tip #1: Format Boolean Calculation

Hello Community,

Hope you guys are doing good. After 6 Months of vacation Started blogging again . Little history, Due to Database error I lost my website content which is 2 years of effort gone in seconds. I am starting blogging with series of Posts going further you will be seeing more of blogpost covering WoW Challenges , Tableau Prep Challenges, Alteryx , MoM Dashboards & Many More Content. Plus I will be Sharing a Tip/Trick or Learning daily so stay tuned

First Tip I am sharing here which I observed few days back

Business Scenario:
Color the Sub Categories based on Profit Ratio , If Profit ratio is Less than 0 Show Red Color , If it is More than 0 then Green Color. With legend Yes or No

Before Knowing the Trick:
1. Creating Calculated
Profit Ratio More than Zero:
IIF(Profit Ratio>0,”Yes”,”No”)

2. Drag this field to color and apply the color for the Legend

  • You are writing the String Calculation more string calculations will decrease the performance . The order of performance is Number and Boolean > date > string calculations when it comes to performance.
  • Why we are going with the above approach just to show the legend a Yes/No


Step 1: Create Simple Boolean Calculated Field
Profit Ratio More than Zero:
Profit Ratio>0

Step 2: Drag This Field to Color

Step 3: You will legend as True or False the requirement is to show the Legend as Yes or No here comes the trick. Right Click on the boolean Calculated Field –> Format

Step 4: Instead of True or False you will be seeing the other options in formatting

Step 5: Select Yes Final Output

With the Tip Used you

  • No Need to Write String Calculations
  • Assume you have 6-7 Calculations to be written same fashion instead of writing 6 String Calculation you can replace with 6 Boolean Calculations which increases the Performance
  • You Can use the Inbuilt formatting feature instead of writing Custom Formatting