Tableau Conditional Formatting 101: Easy Hacks to Modify

Last Modified: August 30th, 2023

Tableau Conditional Formatting

Tableau Conditional Formatting can aid in highlighting patterns and trends in your data. To use it, you create rules that determine how cells are formatted based on their contents. Tableau Conditional Formatting can be applied to a range of cells, an Excel table, and even a PivotTable report in Excel for Windows.

Tableau Conditional Formatting is one of the most widely used methods for quickly classifying data. Color-coding is the most important aspect of this Data Analysis tool, and it essentially means formatting data values based on certain conditions.

This blog is a guide to Tableau Conditional Formatting. You’ll learn how to perform Tableau Conditional Formatting by modifying data and rows and columns in this tutorial.

Table Of Contents 

What is Tableau?

Tableau is a well-known Business Intelligence and Data Analytics tool that was developed to assist in visualizing, analyzing, and understanding complex business data to make data-driven decisions. It is a smart platform that allows businesses to move more quickly and in a way that clients and consumers can understand. The most important feature of this tool is that it makes it extremely simple for users to organize, manage, visualize, and understand data.

Tableau can assist anyone in seeing and comprehending their data. It has various tools to help with that like Tableau filters, Tableau Conditional Formatting, Charts in Tableau etc. You can connect to any database, create visualizations by dragging and dropping, and share them with a single click. The main objective of Tableau is to help people visualize and understand their data. 

Tableau’s Self-service Analytics platform enables anyone to work with data, regardless of their skill level. It was aimed to help users create visuals and graphics without requiring the assistance of a programmer or any prior programming knowledge. It is a highly scalable and easily deployable platform.

Key Features of Tableau

  • Data Sources: Tableau has plenty of data source options from which you can connect and fetch data. Tableau supports a wide range of data sources, including On-premise files, spreadsheets, relational databases, non-relational databases, Data Warehouses, Big Data, and On-cloud data.

    Tableau can connect to any of the data sources securely. You can also merge data from multiple sources to create a visual combinatorial view of data. Tableau also works with a variety of data connectors, including Presto, MemSQL, Google Analytics, Google Sheets, and others.
  • Advanced Visualizations: Tableau has a wide range of visualizations, including basic visualizations like a bar chart and a pie chart, as well as advanced visualizations like a histogram, a Gantt chart, a bullet chart, a motion chart, a treemap, and a boxplot. Any kind of visualization can be selected easily under the visualization type from the Show Me tab.
  • Robust Security: Tableau takes all precautions to protect data and offers robust user security. For data connections and user access, its security system relies on authentication and permission systems. It employs row-level filtering, which aids in the security of the data. It also allows you to connect to other security protocols like Active Directory, Kerberos, and so on.
  • Mobile View: Tableau also provides the mobile version of the software. You can create dashboards and reports that are compatible with your mobile. It also allows you to create customized mobile dashboard layouts that are specific to your mobile device. This feature provides users with a great deal of flexibility and convenience when it comes to managing their data.
  • Cross-Database Join: Tableau 10 introduced Cross-Database Join, a new feature that allows you to cross data between different sources much more quickly and without requiring any additional technical knowledge.

    A Cross-Database Join combines data from two different databases as if they were one. Data sources that join data from multiple databases are created and published so that other Tableau users can create reports.
  • Live and In-Memory Data: Tableau ensures that both live data sources and data extraction from external data sources are connected as in-memory data. This allows the user to utilize data from multiple types of data sources without restriction.

    You can use data directly from the data source by setting up live data connections or keeping that data in memory. Several types of Tableau filters can extract data from a data source as per their requirement.
Simplify your Tableau Data Analysis using Hevo’s No-code Data Pipelines

Hevo Data, a No-code Data Pipeline helps to transfer data from 100+ sources (including 40+ Free Sources) to a Data Warehouse/Destination of your choice and visualize it in your desired BI tool such as Tableau. Hevo is fully managed and completely automates the process of not only loading data from your desired source but also enriching the data and transforming it into an analysis-ready form without even having to write a single line of code. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.

It provides a consistent & reliable solution to manage data in real-time and always have analysis-ready data in your desired destination. It allows you to focus on the key business needs and perform insightful analysis by using a BI tool of your choice.

Get Started with Hevo for Free

Check out what makes Hevo amazing:

  • Secure: Hevo has a fault-tolerant architecture that ensures that the data is handled in a secure, consistent manner with zero data loss.
  • Schema Management: Hevo takes away the tedious task of schema management & automatically detects schema of incoming data and maps it to the destination schema.
  • Transformations: Hevo provides preload transformations through Python code. It also allows you to run transformation code for each event in the Data Pipelines you set up. You need to edit the event object’s properties received in the transform method as a parameter to carry out the transformation. Hevo also offers drag and drop transformations like Date and Control Functions, JSON, and Event Manipulation to name a few. These can be configured and tested before putting them to use.
  • Minimal Learning: Hevo, with its simple and interactive UI, is extremely simple for new customers to work on and perform operations.
  • Hevo Is Built To Scale: As the number of sources and the volume of your data grows, Hevo scales horizontally, handling millions of records per minute with very little latency.
  • Incremental Data Load: Hevo allows the transfer of data that has been modified in real-time. This ensures efficient utilization of bandwidth on both ends.
  • Live Support: The Hevo team is available round the clock to extend exceptional support to its customers through chat, email, and support calls.
  • Live Monitoring: Hevo allows you to monitor the data flow and check where your data is at a particular point in time.
Sign up here for a 14-Day Free Trial!

What is Tableau Conditional Formatting?

Many times during your analysis, you’ll run into situations where you’ll need to classify something quickly. The classification aids in the understanding of significant differences, which can then be used to make critical decisions in the context of the problem.

Tableau Conditional Formatting is one of the most widely used methods for quickly classifying data. As the name implies, color-coding is the most important aspect of Tableau Conditional Formatting data analysis tool, and it essentially means formatting data values based on certain conditions.

Tableau Conditional Formatting has features that enable the concept to be applied even to graphs, making visualizations more interactive and communicative.

Tableau Conditional Formatting is a good way to draw attention to textual information. Color and Symbols are two common examples of Tableau Conditional Formatting. When you use conditional formatting in Tableau visualizations, you can quickly highlight important data.

Understanding the Tableau Conditional Formatting Process

Modifying Rows & Columns 

Modifying Rows & Columns helps you get a better understanding of data and helps you get the information you need. Rows & Columns can be modified easily using Tableau Conditional Formatting feature.

Microsoft Excel is generally used to perform Condition Formatting. You have a ready-to-use option in Microsoft Excel that formats the background color of the cells based on the values. The color intensity varies depending on the magnitude of the value. However, to use Tableau Conditional Formatting in your analysis, things get a little tricky. To achieve this in Tableau Conditional Formatting follow the steps below:

  • Step 1: Profit and sales figures for twenty major Indian cities are included in your data. Tableau has been used to load the data. Moving to the sheet tab, you can see the only dimension City, as well as the two measures Profit and Sales, all of which are present in their own sections.
  • Step 2: To begin, drag the City Dimension into the Rows region, as shown below.
  • Step 3: Create a Calculated Field as shown below:
  • Step 4: Create a calculated field called 1.0 and type 1.0 in the code section. This field can be found in the Measures section after it has been created, as shown below.
  • Step 5: Drag each of the calculated fields 1.0 into the Columns region one at a time. AVG should be used instead of 1.0. (Average). To do so, select Average in Measure from the field’s dropdown menu.
  • Step 6: Now, select Dual Axis from the dropdown menu of the second 1.0 measure.
  • Step 7: The top and bottom axes will be changed now. Right-click on the top axis and select Edit Axis from the pop-up menu.
  • Step 8: The Edit Axis dialogue box’s default selections and values are shown below.
  • Step 9: Make the changes shown below in the General section of the Edit Axis dialogue box.
  • Step 10: Select None for Major Tick Marks and Minor Tick Marks in the Tick Marks section of the dialog box.
  • Step 11: Changes in both the General and Tick Marks sections of the bottom axis are similar to those in the top axis, except that the title is left blank in the General section, as shown below.
  • Step 12: Following the steps above for Tableau Conditional Formatting, you get the following visualization. Because you have value 2 in the Fixed end in the General section of the Edit Axis dialogue box, and value 1 in the 1.0 field, the blue bars are half the size of the cell.
  • Step 13: To get full-size bars, double-click the first 1.0 measure pill and simply add 1 as shown below.
  • Step 14: The steps above result in full-size in-cell bars, as shown below.
  • Step 15: Drag Profit over Color for the first 1.0 field in the Marks Card. This results in a variety of colored bars. Please note that the different colored bars represent different Profit measure values.
  •  Step 16: Drag Profit over Text in Marks to the second 1.0 measure, and values will appear in the cells as shown below.
  • Step 17: The colors haven’t filled the entire cell in the previous step, as you can see. To fill the entire cell with color, drag the size slider to the rightmost side for the first 1.0 field and select the largest size. The following diagram depicts this. The cells are now completely colored, as you can see.
  • Step 18: If the brightness of the background colors is too bright, you can reduce it by adjusting the opacity using the Opacity slider in the Color section, based on your needs. You chose to keep the opacity at 90% in this case. Similarly, the second 1.0 measure can be used to change the opacity of text values.
  • However, the opacity of text values should be set to 100% to ensure that they stand out against the background colors. It’s worth noting that negative values are clearly distinguished from positive values in the visualization below.
  • Negative values are indicated by orange, while positive values are indicated by blue. Furthermore, the degree of brightness for the color changes depending on the value.
  • Step 19: You completed the steps above for the Profit metric. In the dataset, you have another important metric called Sales. You intend to conduct a similar analysis for measuring Sales as well. Simply repeat the steps above. Finally, change the color of Sales to Green, as shown below, or any other suitable color.
  • Step 20: Now, the Tableau Conditional Formatting Analysis you performed looks like this. The color assigned based on the range of Profit and Sales values can be seen on the right side. The concept’s name comes from the values-based color-based formatting that provides critical data insights.
  • Step 21: The image below shows a more detailed view of the Tableau Conditional Formatting Analysis you performed.

Modifying Data

You can modify data in with the help of Tableau Conditional Formatting feature. This makes data more readable.

You’re working with distribution volume data here, which is volume distributed by distributed units. Region and Distribution Unit are important dimensions, and Distribution Volume is a measure.

The goal is to categorize distribution units based on their volume of distribution using the feature Tableau Conditional Formatting. You’ll divide them into units with very high, high, moderate, and low volume distribution. Here’s how you’ll go about doing it:

  • Step 1: To load the data source, go to the Data menu and select New Data Source. Alternatively, select Connect to Data from the drop-down menu.
  • Step 2: Select the required data source type in the Connect section. It’s Microsoft Excel in this case. The data should then be loaded.
  • Step 3: The data that has been loaded can be seen in the Data Source tab, which is shown below.
  • Step 4: When you switch to the sheet tab, you can see the dataset’s dimensions and measures. They can be found in the appropriate sections.
  • Step 5: To begin, drag the Distribution Unit dimension into the Rows region and the Distribution Volume dimension into the Columns region. As shown below, a horizontal bar chart is created. If the default chart type isn’t a bar chart, choose one in Show Me.
  • Step 6: By moving the cursor over the Sort icon as shown below, you can sort the results in descending order.
  • Step 7: Following that, you’ll create three parameters to help you achieve your goal. The parameters will primarily aid in the classification of distribution units based on distribution volumes. To make the first parameter, right-click anywhere in the Data section’s blank space and select Create Parameter from the menu that appears, as shown below.
  • Step 8: Following the steps above, the Create Parameter dialogue box appears, as shown below.
  • Step 9: In the Create Parameter dialogue box, make the following adjustments. Change the name to Threshold 1, keep the data type to Float, and set the current value to 100,000, with Automatic as the Display format and All as the Allowable values. To complete the process, click OK.
  • Step 10: Create a second parameter called Threshold 2, with the Current value set to 50,000 and the rest of the details as shown below.
  • Step 11: Finally, add the third parameter to the equation. Threshold 3 is the name you give it. Set the current value of this parameter to 25,000, and the rest of the parameters as shown below.
  • Step 12: You can see the three parameters you created in the image below. You’ll now put them to use to accomplish your goal.
  • Step 13: If you don’t use the parameters you created in a calculated field to categorize distribution units based on distribution volume correctly, they won’t serve your purpose. As a result, you’ll have to create a calculated field. To do so, right-click anywhere in the Data section’s blank space and choose Create Calculated Field.
  • Step 14: As you can see, the field you created looks like this. DU Classification is the name you gave it. The most important point is that in the calculated field, you used the three parameters you created earlier. If the value of any distribution unit is greater than Threshold 1, i.e. 100,000, the code will classify it as Very High Volume DU.
  • It will also handle the other classifications in the same way. Here, you didn’t hard code the values in the field because doing so might prevent you from dealing with context-dependent changes.
  • If you have parameters at your disposal, changing parameter values will be reflected in the calculated field as the context changes.
  • E.g. If you want to categorize distribution units with a distribution volume of more than 200,000 as Very High Volume DUs, you can simply change the Current value for Threshold 1 from 100,000 to 200,000 without changing the value in the calculated field.
  • Step 15: Under Measures, the calculated field DU Classification appears, as shown below.
  • Step 16: Simply drag the calculated field DU Classification over Color in Marks, and the Distribution Units will be divided into four categories based on their volume contribution, as shown below. The categories are listed on the right side of the page.
  • Step 17: Examine the visualization by Tableau Conditional Formatting in greater detail. You can also change the order of the categories in the legend by dragging a category up or down with your mouse. The categories appear to be in the correct order in legend now.
  • Step 18: A category’s color can also be changed. To do so, go to the Marks card and click on Color, then Edit Colors to make the necessary color selections.

You can also modify data by highlighting the top five and bottom five cities. Below are the steps how you can do it: 

  • Step 1: As shown below, the data has been loaded with dimensions and measures.
  • Step 2: As shown below, drag the Distribution Unit dimension into the Rows region and measure Distribution Volume over Text in the Marks card.
  • Step 3: Sort the results in descending order so that the cities are listed in order of Distribution Volume from highest to lowest.
  • Step 4: Create a calculated field next. The steps for making a calculated field have already been demonstrated. Name the calculated field Top 5 & Bottom 5 to highlight the top five and bottom five distribution units. The INDEX() and LAST() functions are used in the code section.
  • The INDEX() function returns the current row’s index, while LAST() returns the number of rows between the current and last rows. INDEX() calculates from 1 to 0, whereas LAST() calculates from 0 to 1. The two functions have been combined in the example below.
  • Step 5: As shown below, the newly created calculated field appears as a measure.
  • Step 6: Simply drag the newly created calculated field Top 5 & Bottom 5 over Color in the Marks card, and the top and bottom five regions will be highlighted in red. As seen on the right side of the screen, the categories appear as False and True values.

Conclusion

This blog helps you gain a better understanding of Tableau Conditional Formatting by looking at various illustrations. However, because it is a highly interactive visualization tool, it can be used in a variety of ways that necessitate the use of the tool’s features. It makes it easier to apply Tableau Conditional Formatting to visualizations without limiting them to a specific format.

As you collect and manage your data across several applications and databases in your business, it is important to consolidate it for complete performance analysis of your business. To achieve this you need to assign a portion of your engineering bandwidth to Integrate data from all sources, Clean & Transform it, and finally, Load it to a Cloud Data Warehouse, BI Tool like Tableau, or a destination of your choice for further Business Analytics. All of these challenges can be comfortably solved by a Cloud-based ETL tool such as Hevo Data.   

Visit our Website to Explore Hevo

Hevo Data, a No-code Data Pipeline can seamlessly transfer data from a vast sea of 100+ sources to a Data Warehouse, BI Tool like Tableau, or a Destination of your choice. It is a reliable, completely automated, and secure service that doesn’t require you to write any code!  

If you are using Tableau as your Data Analytics & Business Intelligence platform and searching for a no-fuss alternative to Manual Data Integration, then Hevo can effortlessly automate this for you. Hevo, with its strong integration with 100+ sources and BI tools(Including 40+ Free Sources), allows you to not only export & load data but also transform & enrich your data & make it analysis-ready in a jiffy.

Want to take Hevo for a ride? Sign Up for a 14-day free trial and simplify your Data Integration process. Do check out the pricing details to understand which plan fulfills all your business needs.

Harshitha Balasankula
Former Marketing Content Analyst, Hevo Data

Harshita is a data analysis enthusiast with a keen interest for data, software architecture, and writing technical content. Her passion towards contributing to the field drives her in creating in-depth articles on diverse topics related to the data industry.

No-code Data Pipeline For Tableau