DendrogramHow items join into clusters.
The most alike items join first, at the bottom. Groups join higher up. Cut the tree at any height and the branches below are your clusters.
- Answers How are things connected?
- Your data a few measures per item
- Items about 5 to 60
- Height the distance between what joins
- Excel and Power BI Python or R
What is a dendrogram?
A dendrogram is a tree that shows how items join into clusters. It starts with every item on its own at the bottom; the two most alike join first, then the next closest pair or group, and so on until everything is one cluster at the top. Each join is drawn at the height of the distance between what it joins, so low joins are close friends and high joins are distant cousins. Cutting the tree at a height gives groups: every branch below the cut is one cluster.
A shop compares eight customers by how often they order and how much they spend per order. Three groups appear: frequent small baskets, rare big baskets, and two customers in between.
Why use a dendrogram?
Because it shows groups at every level at once.
- Groups without guessing. The data decides which items belong together.
- Any number of groups. Cut higher for fewer, lower for more.
- How close. The height of each join says how alike the items are.
- Behind the scenes. Clustered heat maps and customer segments are often built on one.
How does a dendrogram work?
Four steps turn measures into a tree.
- Step 1 of 4One dot per itemEach customer at the bottom, measured on a common scale so euros do not outweigh orders.
- Step 2 of 4Join the closest twoAna and Cem are the most alike: they join first, low down.
- Step 3 of 4Keep joiningThe next closest pair or group joins, higher each time, until all are one.
- Step 4 of 4Cut into groupsA line at height 1: each branch below it is one cluster.
The distance between two groups here is the average distance between their members (average linkage); other rules use the closest or the farthest pair.
What are the parts of a dendrogram?
Four parts, and each one has a job.
- Leafone item, at the bottom
- Joinwhere two items or groups meet
- Heightthe distance at which they join
- Cuta height that splits the tree into groups
How do you read a dendrogram?
Three looks, in this order.
- Find the lowest joinsAna and Cem join first: nearly the same orders and baskets.
- Read the groups below the cutThree groups: Ana, Ben, Cem; Gus and Hana; Dora, Eli, Finn.
- Find the highest joinThe big-basket group joins the rest last: the most different.
What kinds of dendrogram are there?
The same customers, three ways.
- Kind 1Cut into threeThree clusters below height 1.
- Kind 2Cut into twoGus and Hana fall in with the small baskets.
- Kind 3No cutThe whole tree, groups left to the reader.
A dendrogram can also lie on its side, with names on the left, and it often sits along the edge of a heat map to sort its rows and columns.
When should you use a dendrogram?
When you want groups to come from the data, and see how firm they are.
- items have a few measures each
- you look for natural groups
- the number of groups is open
- there are about 5 to 60 items
- there are only two measures and few items (a scatter plot shows the groups directly)
- there are thousands of items (cluster first, then chart the groups)
- the hierarchy is known (a tree diagram)
Dendrogram or scatter plot?
A tree for many measures, dots for two.
With only two measures, the scatter plot shows the three groups directly: one corner for small baskets, another for big ones. The dendrogram says the same with numbers on how close each pair is, and it still works with five or twenty measures, where no scatter plot can.
How do you make a dendrogram?
Python or R, inside Power BI if needed.
Excel has no dendrogram. In Python, scipy.cluster.hierarchy does the joining (linkage) and the drawing (dendrogram); in R, hclust and plot. Both run inside Power BI's Python and R visuals. Put the measures on a common scale first (each minus its average, divided by its spread), or the measure with the biggest numbers decides alone.
What goes wrong with dendrograms?
The most common mistake, and its fix: measures on different scales.
| Mistake | Why it hurts | Fix |
|---|---|---|
| Measures on raw scales | The biggest numbers decide alone | Put them on a common scale |
| Reading the left-right order | Branches can swap freely | Read heights, not order |
| One cut taken as the truth | Groups depend on the cut | Show where the cut is and why |
| Too many items | Leaves and names crowd | About 5 to 60, or cluster first |
| Unknown joining rule | Trees differ by rule | Say which rule (average, closest, farthest) |
Every chart for “How are things connected?”
Read on, step by step.
Does it fit your data? Try it.
Paste your table into Chart Compass, say what the chart should show, and see the charts that fit, drawn with your own numbers. It runs in your browser, so the data stays with you.