Treemaps in Power BI
Treemaps display hierarchical data as a set of nested rectangles. Each level of the hierarchy is represented by a colored rectangle (branch) containing smaller rectangles (leaves). Power BI bases the size of the space inside each rectangle on the measured value. The rectangles are arranged in size from top left (largest) to bottom right (smallest).
For example, if you're analyzing your sales, you might have top-level branches for the clothing categories: Urban, Rural, Youth, and Mix. Power BI would split your category rectangles into leaves, for the clothing manufacturers within that category. These leaves would be sized and shaded based on the number sold.
In the Urban branch above, lots of VanArsdel clothing was sold. Less Natura and Fama was sold. Only a few Leo were sold. So, the Urban branch of your Treemap has:
The largest rectangle for VanArsdel in the top-left corner.
Slightly smaller rectangles for Natura and Fama.
Lots of other rectangles for all the other clothing sold.
A tiny rectangle for Leo.
You could compare the number of items sold across the other clothing categories by comparing the size and shading of each leaf node; larger and darker rectangles mean higher value.
Want to watch someone else create a treemap first? Skip to 2:10 in this video to watch Amanda create a treemap.
When to use a treemap
Treemaps are a great choice:
To display large amounts of hierarchical data.
When a bar chart can't effectively handle the large number of values.
To show the proportions between each part and the whole.
To show the pattern of the distribution of the measure across each level of categories in the hierarchy.
To show attributes using size and color coding.
To spot patterns, outliers, most-important contributors, and exceptions.
The Power BI service or Power BI Desktop
Retail Analysis Sample report
Get the Retail Analysis Sample report
These instructions use the Retail Analysis Sample. Creating a visualization requires edit permissions to the dataset and report. Luckily, the Power BI samples are all editable. If someone shares a report with you, you can't create visualizations in reports. To follow along, get the Retail Analysis Sample report.
After you get the Retail Analysis Sample dataset, you can get started.
Create a basic treemap
You'll create a report and add a basic treemap.
From My Workspace, select Datasets > Create a report.
From the Fields pane, select the Sales > Last Year Sales measure.
Select the treemap icon to convert the chart to a treemap.
Drag Item > Category to the Group well.
Power BI creates a treemap where the size of the rectangles is based on total sales and the color represents the category. In essence you've created a hierarchy that visually describes the relative size of total sales by category. The Men's category has the highest sales and the Hosiery category has the lowest.
Drag Store > Chain to the Details well to complete your treemap. You can now compare last year's sales by category and chain.
Color Saturation and Details cannot be used at the same time.
Hover over a Chain area to reveal the tooltip for that portion of the Category.
For example, hovering over Fashions Direct in the 090-Home rectangle reveals the tooltip for Fashion Direct's portion of the Home category.
Add the treemap as a dashboard tile (pin the visual).
Save the report.
Highlighting and cross-filtering
For information about using the Filters pane, see Add a filter to a report.
Highlighting a Category or Detail in a treemap cross-highlights and cross-filters the other visualizations on the report page and the other way around. To follow along, either add some visuals to this report page or copy the treemap to one of the other pages in this report.
On the treemap, select either a Category or a Chain within a Category. That will cross-highlight the other visualizations on the page. Selecting 050-Shoes, for example, shows you that last year's sales for shoes was $3,640,471 with Fashions Direct accounting for $2,174,185 of those sales.
In the Last Year Sales by Chain pie chart, selecting the Fashions Direct slice, cross-filters the treemap.
To manage how charts cross-highlight and cross-filter each other, see Change how visuals interact in a Power BI report.