How to Use Treemap in Power BI

Cody Schneider8 min read

A treemap in Power BI is one of the best ways to display hierarchical data in a visually compact and compelling format. Unlike a standard pie or bar chart, it lets you see the composition of a whole and the proportional relationships between different categories all at once. This article walks you through exactly what a treemap is, when to use one, and how to build and customize it step-by-step in Power BI.

What is a Treemap Chart?

Think of a treemap as a series of nested rectangles. The entire chart represents a total value, like total annual sales. This large rectangle is then divided into smaller rectangles, each representing a major category, such as "Electronics," "Apparel," and "Home Goods." The size of each category's rectangle is directly proportional to its value - so if Electronics makes up 50% of your sales, its rectangle will take up half the space.

But it doesn’t stop there. Each of those category rectangles can be further subdivided into even smaller rectangles representing sub-categories. For instance, the "Electronics" box could be broken down into "Laptops," "Smartphones," and "TVs." This nested structure allows you to visualize multiple levels of your data hierarchy in a single view.

Here’s what makes a treemap effective:

  • Size: Represents a quantitative value. A larger rectangle means a larger value (e.g., higher sales, more website traffic).
  • Color: Can represent a second quantitative measure. For example, sales value could determine the size, while profit margin determines the color intensity - a dark green for high-margin products and a light green for low-margin ones.
  • Grouping: The nested structure intuitively shows parent-child relationships in your data.

Pros and Cons of Using Treemaps

Treemaps are incredibly useful, but they aren’t a perfect fit for every situation. Understanding their strengths and weaknesses helps you decide when to use them.

Pros:

  • Efficient Use of Space: They pack a lot of hierarchical information into a relatively small area, making them ideal for dashboards where space is limited.
  • Good for Spotting Patterns: It’s easy to spot the largest contributors to a whole at a glance. When color saturation is added, anomalies - like a large category with very low profitability - jump out immediately.
  • Handles Large Datasets: Treemaps can effectively display thousands of data points without becoming overly cluttered, especially when compared to a pie chart with too many slices.

Cons:

  • Poor for Precise Comparisons: The human eye isn't great at accurately comparing the areas of differently shaped rectangles. While you can tell which is bigger, it's hard to judge by how much. A bar chart is better for precise comparisons.
  • Potential for Clutter: If a category has hundreds of tiny sub-categories, the treemap can become a collection of indecipherable slivers.
  • Not Ideal for Showing Change Over Time: A treemap displays a snapshot of data at a specific point in time. A line or area chart is far better for demonstrating trends.

When to Use a Treemap in Power BI

The best use cases for treemaps involve exploring the composition of a measure and identifying the biggest contributors within a hierarchical structure. Here are a few practical examples:

Example 1: Analyzing Sales Performance Imagine you want to see which product categories are driving the most revenue. A treemap could show your main categories (e.g., Laptops, Desktops, Accessories). The size of each rectangle would represent its total sales. You could then add profit margin as the color saturation to quickly see if your top-selling products are also your most profitable.

Example 2: Visualizing Website Traffic You could use a treemap to break down website sessions by traffic source (Organic, Paid, Direct, Referral). Sizing the rectangles by the number of sessions shows which source brings in the most visitors. Adding bounce rate as a color saturation could highlight sources that bring low-quality traffic (e.g., a large rectangle with a bright red color).

Example 3: Budgeting and Expense Tracking A treemap is perfect for breaking down company expenditures. The primary rectangles could be departments (e.g., Marketing, Sales, Engineering), with their size representing the total budget. Nested rectangles could show spending by category (e.g., Salaries, Software, Travel). This makes it easy for finance teams to spot which departments or expense types consume the largest portions of the budget.

How to Create a Treemap in Power BI (Step-by-Step)

Creating your first treemap in Power BI is straightforward. Let’s walk through the process using a sample dataset of product sales with categories, sub-categories, and revenues.

Step 1: Prepare Your Data

First, ensure your data is loaded into Power BI and is properly structured for a treemap. You'll need:

  • At least one categorical field for the groups (e.g., "Product Category").
  • An optional secondary categorical field for the details/sub-groups (e.g., "Product Sub-Category").
  • At least one numerical field for the values that will determine the rectangle sizes (e.g., "Total Sales").
  • An optional secondary numerical field for the color saturation (e.g., "Profit").

Step 2: Add the Treemap Visual to Your Report

In your Power BI report canvas, navigate to the Visualizations pane on the right. Find the treemap icon (it looks like a set of nested rectangles) and click it to add an empty treemap visual to your canvas.

With an empty treemap placeholder now on your report page, you're ready to start adding data.

Step 3: Add in Your Data Fields

With the new treemap visual selected, you'll see several buckets in the Visualizations pane: Category, Details, Values, and Tooltips.

  1. Drag your main categorical field to the "Category" bucket. For our example, let’s drag "Product Category" here. This creates the primary rectangles.
  2. Drag your secondary categorical field to the "Details" bucket. Next, drag "Product Sub-Category" into the "Details" bucket. You'll instantly see the main category rectangles subdivide into smaller rectangles for each sub-category.
  3. Drag your numerical measure into the "Values" bucket. This measure determines the size of each rectangle. Drag "Total Sales" into the "Values" bucket and watch as the rectangles resize based on their sales contribution.

At this point, you have a functional treemap! You can clearly see sales distribution across categories and sub-categories.

Customizing and Formatting Your Treemap

A basic treemap is useful, but formatting transforms it into a polished, insightful communication tool. Select your treemap, then click the paintbrush icon ("Format your visual") in the Visualizations pane to find formatting options.

Legend

If you don't have a field in the "Details" bucket, Power BI displays a legend by default. You can toggle this on or off and control its position (e.g., Top center, Bottom right), text formatting, and title under the Legend section.

Colors

Under the Colors dropdown, you can change the color associated with each of your main categories. Instead of letting Power BI choose, you can assign brand-specific colors or use colors that create logical groupings for your audience. For more advanced coloring controlled by your data, you can use conditional formatting. Simply click the fx button next to the Colors option. This lets you set rules to color rectangles based on another value. For example, you could set up a rule where profit margins above 15% are green and those below 5% are red. This instantly draws attention to your most and least profitable areas.

Data Labels

These are the text labels that appear inside each rectangle. You can:

  • Toggle them on or off. Sometimes, you may want a cleaner look and rely on tooltips for the values.
  • Adjust Font and Color: Increase the text size for readability or change the color to provide better contrast against the rectangle's background.
  • Set Display Units: Change how values are displayed - as thousands (K), millions (M), or billions (B). This keeps labels concise.

Category Labels

Category labels are the headings for the larger, primary rectangles. If your main category names are being cut off, you can increase the font size or adjust the color for emphasis. Turning these labels on helps viewers quickly understand the chart's structure, especially for those unfamiliar with the data.

Title

The default title is often just a concatenation of your field names (e.g., "Sum of Sales by Product Category and Product Sub-Category"). Change this to something more descriptive and human-readable, like "Drilling Down Revenue by Product Category," which you can edit under 'General > Title.'

Final Thoughts

The treemap chart in Power BI is an excellent choice for visualizing how a whole is divided into its hierarchical parts. By following the steps above, you can confidently create and format effective treemaps that expose valuable insights, helping you spot key contributors, outliers, and patterns in your data at a single glance.

While mastering visuals in tools like Power BI is a valuable skill, the process of connecting data sources and building reports from scratch is often a significant time drain. We experienced this friction ourselves, which is why we built Graphed. Our platform automates the tedious work by connecting directly to your marketing and sales sources like Google Analytics, Shopify, and Salesforce. You can then simply ask in plain English for what you need - "Build me a treemap of sessions by traffic source, sized by conversions" - and get a real-time, shareable dashboard in seconds.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.