Treemaps use a series of nested rectangles to represent hierarchical relationships of parts to the whole. Treemaps are particularly useful when you have hierarchies and dimensions with high cardinality (a high number of distinct values).
Here is an example of a treemap that shows how sales of each Item add up to give total sales by Category, then Department, and finally total sales overall. Profit has been encoded by Color to add additional analytical value to the visualization. It is now easy to pick out items with the negative profit that have relatively high sales when placed in the context of the whole:
To create a treemap, you simply need to place a measure on the Size shelf and a dimension on the Detail shelf. You can add additional dimensions to the level of detail to increase the detail of the view. Tableau will add borders of varying thickness to separate the levels of detail created by multiple dimensions. Note that in the previous view you can easily see the division of departments, categories, and items. You can adjust the border of the lowest level by clicking on the Color shelf.
The order of the dimensions on the Marks card defines the way the treemap groups the rectangles. Additionally, you can add dimensions to rows or columns to slice the treemap into multiple treemaps. The end result is effectively a bar chart of treemaps:
The preceding treemap not only demonstrates the ability to have multiple rows (or columns) of treemaps, it demonstrates the technique of placing multiple fields on the Color shelf. This can only be done with discrete fields. You can assign two or more colors by holding the Shift key while dropping the second field on Color. Alternately, the icon or space to the left of each field on the Marks card can be clicked to change which shelf is used for the field: