Power BI Treemaps

A few days ago, I was assigned a task to create a Report in Power BI based on the ‘Product Order Data’, which analyzes the sales profit by Product, category, and subcategory at different hierarchical levels.

For this, I used a ‘Treemap’ visual in a Power BI report that represents the hierarchical data in a set of nested rectangles.

Power BI treemap visual

In this Power BI tutorial, I will explain the Tree Map in Power BI. Also, I will cover the points mentioned below:

  • Create a TreeMap on a Power BI Report
  • Displaying Multiple Values in Power BI Treemap
  • Show the Top 10 Elements in Treemap Power BI
  • Power BI Treemap Set Drill Down & Drill Up Feature
  • Show Value as Percentage on Power BI Treemap
  • Sort Elements Order in Power BI Treemap

Tree Map in Power BI

A Tree Map visualization in Power BI displays the hierarchical data in the form of nested rectangles. Each rectangle displays the category or a subcategory in the Tree map.

Check out the points below about the Tree Map visual:

  1. Each hierarchy level is represented by a single, colored rectangle called a “Branch node”.
  2. Inside the branch node, it has smaller rectangles called “Leaf nodes”.
  3. The larger and darker shaded rectangles (Nodes) indicate higher values.

The rectangles are arranged in such a manner, i.e, the larger branch node at the top left and the smallest branch at the bottom. The arrangement of leaf nodes also follows the same pattern.

Power BI uses the measure value to determine the rectangle size for a branch node and leaf nodes.

You can have a look at the image below, which shows the tree map visual in Power BI:

Power bi tree map

From the image displayed above, the rectangles represent:

  • Blue, Yellow, and Pink Rectangle – Branch nodes with Product Categories like Office supplies, Technology, and Furniture.
  • Small rectangles inside each branch are leaf nodes, which show the product subcategory inside each category.

When to use Tree Map in Power BI?

Below, I will display the scenarios where the tree maps can be used.

  • To display the large amounts of hierarchical data on a Power BI report.
  • When a bar chart cannot handle a large number of values.
  • To represent the attributes using color coding and size.

Create a Tree Map Visualization In Power BI

Here, I will show you how to add a Tree Map visual in Power BI.

I have a Product Order Data in an Excel file with the following columns, as shown in the screenshot below.

Tree map visual in Power bi

I want to create a tree map on the Power BI report that shows Category, Subcategory, and Profit.

  1. Open your Power BI Desktop, connect the data source using the ‘Get data’ option from the ribbon.
  2. Under the visualization pane, select the ‘Treemap’. Then, an empty treempa will be created that does not have any fields.
Treemap in power bi
  1. Now, drag and drop the values from the Data pane to the fields pane.
    • Category – Drag and drop ‘Category’
    • Details – Add ‘Sub Category’
    • Values – Choose to add ‘Profit’
Tree Map Power BI

In the screenshot below, you can see the Power BI treemap visual.

Power BI Create Tree Map

Display Multiple Values in Power BI Treemap

Here, I will show you how to display multiple values on a tree map visual in Power BI.

The image below shows the Tree map with the values of Category, Subcategory, and Profit of a product.

Tree Map Power BI Multiple values

I want to display or add multiple values [Product, Quantity, and Sales] on the data point tab in the tree map.

You can do this by adding values in the Tooltips option. Check out the quick steps below:

  1. Under the Visualizations pane, select Build visual section.
  2. In the tooltip field, drag and drop the values from the data pane into this [Product, Quantity, and Sales].
Treemap Powerbi
  1. Now, when you hover over the treemap, it will display multiple values as datalabels. Refer to the image below:
Power bi treemap example

Show Top 10 Values in Power BI Treemap

Let me show you how to display the top ’10’ values on the Power BI Tree map.

Consider a scenario where you want to show the top 10 selling products with the sales amount.

Below are the steps to follow:

  1. In Power BI Desktop, select the tree map from the visualization pane.
  2. On the ‘Category’ field, drag and drop the ‘Products’ from the data pane.
  3. Similarly, in the value field, drag and drop the ‘Sales‘ from the field pane.
Show Top 10 on Power BI treemap
  1. Now, go to the Filters pane, expand the ‘Product Name’ field, and select the Filter Type as ‘Top N’.
  2. Under Show items, select 10.
  3. Next, drag and drop the field you want to filter by; in my case, it’s sales. Click on Apply filter.
Power BI treemap top 10

After that, you can see the applied changes in the Power BI Tree map, which shows the top 10 selling products.

Power bi treemap show top 10

Set Up Drill Down and Drill Up in Power BI Treemap Visualization

Let me show you how to drill down and drill up through the hierarchy levels in the Treemap visualization of Power BI.

Here is the image of the Treemap that has hierarchy levels of [Category, Sub-category, and Product Name].

Treemap drill down Power BI

To drill down all the levels of the category in the Power BI Tree map, see the steps mentioned:

  1. In Power BI Desktop, select the treemap from the visualization.
  2. In the Category field, drag and drop multiple values from the data pane. Here, I have added [Category, Sub-category, and Product Name].
  3. In the Value field, drag and drop the Sales from the Data pane.
Tree map drill down in Power BI
  1. Click on the drill-down icon, present at the top of the treemap visualization, to expand all levels down in the hierarchy.
Drill down in Power BI tree map

You can see the treemap drill-down in the Power BI Desktop in the screenshot below.

Power bi treemap drill down
  1. Similarly, to drill up to the first hierarchy level, click on the ‘Drill up’ icon for each level.
How to use treemap in Power bi

By doing this, you can return to the first hierarchy level, as shown in the image below.

Treemap visualization Power bi

Display Value as Percentage on Power BI Treemap

In this section, I will explain how to show the value and percentage on the tree map visual in Power BI.

The image represented below shows the Power BI Tree map, with the values like [Product, Category, and Sub category].

Power BI Treemap show percentage

I wanted to display the Profit value as a percentage on the tree map for all the products.

Follow the steps here to display the value as a percentage:

  1. On the Power BI report, select the tree map.
  2. Go to the Formatting section under visualization, turn on the Data label.
Treemap visualization in Power bi
  1. Next, click on the Build visual under the visualizations pane, click the drop-down menu in the value field, and select “Show value as”> select “Percent of grand total.
Power bi treemap show value percentage

From the screenshot below, you can see that Power BI Treemap is displaying the profit value as a percentage.

Power bi treemap visualization

Sort Elements Order in Power BI Treemap

In Power BI, a tree map visual will sort the values by default. The rectangles will be arranged in size from left [largest] to the bottom right[smallest].

From the Screenshot below, you can see that the higher values are arranged from left to right.

  • Paper – 67.59k
  • Binders – 40.76k
  • Copiers – 25.00k
  • Labels – 24.14k
  • Accessories – 22.00k
  • Tables – 21.67k etc.
Treemaps in Power BI
  • In a Power BI treemap, the top left element will be the highest value.
  • In the treemap, all the other elements are arranged by value, flowing down from the top.

Note:

You can not arrange or sort the rectangular tiles in alphabetical order, because it will be arranged based on the value of category.

When working with the tree map visual in Power BI, keep in mind this limitation: you can either use the ‘Details’ option to specify the rectangle’s colors or use ‘Data colors’ to color the rectangles, but not both options at the same time.

You may also Learn Other Power BI Tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…