top of page
Search

# How to Make a Dendrogram Chart in Tableau

Hello Readers! This blog is all about the Dendrogram chart. While exploring new chart types, I discovered a captivating and easily understandable Dendrogram Chart. In this guide, I will demonstrate how to create a Dendrogram chart combined with a Bar chart.

What is a Dendrogram Chart?

Dendrogram charts are tree diagrams used in hierarchical clustering to show relationships between different data sets. They are great for visualizing how clusters of data are arranged. While Tableau doesn't have a built-in dendrogram chart, you can create one using calculated fields and hierarchical data.

Here  is a step-by-step guide on how to make a dendrogram chart in Tableau using Sales Dataset:

Step 1: Prepare Your Data

• Before starting, ensure your data is structured to show hierarchical relationships. Your data should have columns for each level of the hierarchy. For example, if you're clustering customers based on purchasing behavior, you might include:

• Order ID

• Cluster Level 1

• Cluster Level 2

• Cluster Level 3

Step 2: Connect to Your Data Source

1. Open Tableau and connect to your data source.

2. Make sure your data is clean and properly formatted.

a.  Create a path field with 0 and 200 in excel and copy and paste it in data source in tableau.

b. Join both tables using create join calculation by typing 1.

b.Partition join is created and now, you can see for each row , we have two values of the path section 0 and 200 and join sheet 1 with source data using join.

Path(bin): This helps to create evenly spread data points between the start and end points (i.e 0 and 200). Create a path bin and edit the size of bins as 1.

Step 3. Create Calculated Fields:

1. Open the Data Pane:

• Right-click on your data source and select Create Calculated Field.

1. Calculated Field:

• We need to create some calculated fields to get the Dendrogram Chart.

Step 4 :Plotting the Graph

o   Drag and drop @x to Column and both @y and Path(bin) to Row. In path(bin) make sure the ‘show missing value’ is selected.

o   Change the marks to the line and move the path(bin) from Row to path in the marks and put Sub-category in color.

• Edit Table Calculation to get the proper shape of the Dendrogram Chart.

For X

·        Right-click on X in the Rows and select compute using Path(bin)

For Y

·        Right-click on Y in the Columns and select compute using Path(bin)

·        Again Right click on Y and select Edit Table Calculation.

In Nested Calculations

For Y: Select Sub-Category and deselect Path(bin).

For Rank: Select Sub-Category and deselect Path(bin).

The chart will look like the one below:

Step 5:Include Bar chart in the Dendrogram Chart

o   To include bar chart in the Dendrogram chart we need to drag and drop the calculated field ‘size’ in size under Marks

o   Right-click on Size and select Compute using Path(Bins)

o   Again ,Right click on Y and select Edit Table Calculation.

In Nested Calculations:

For Percentage Adjusted: Select both Path(Bin) and Sub-Category

For Total Sales: Select both Path(Bin) and Sub-Category

Now the chart will look like this.

o   To include nodes or circle at the start and end point put the sum of sales in size in marks.

Step 6: Format the Chart

1. Adjust the Aesthetics:

• Customize colors, sizes, and shapes of the marks to enhance readability.

• Use color to differentiate between different clusters or hierarchical levels.

• Format the Chart by removing the Gridlines.

• Add relevant information to tooltips for better insights when hovering over nodes.

Right click on the X and axis and deselect the Show header to remove the header in the chart.

This is the final outcome of the Dendrogram chart for Sub-Category wise Sales Percentage.

Conclusion

Creating a dendrogram chart in Tableau requires a good understanding of hierarchical data and some creative use of calculated fields and coordinates. By following these steps, you can build a dendrogram that effectively visualizes hierarchical relationships and clusters within your data.

Experiment with different settings and data sets to refine your dendrogram and make it a powerful tool for your data analysis needs. Happy visualizing!