What is a Treemap in Power BI?
A Power BI treemap is one of the best ways to visualize hierarchical data, showing the big picture and the tiny details all in one condensed chart. It lets you spot patterns and compare proportions across different categories at a glance. This article breaks down exactly what a treemap is, when to use it, and how to create and format one step-by-step in Power BI.
What Exactly is a Treemap Chart?
Imagine you're looking at a big rectangle that represents all of your sales for the year. Now, imagine that rectangle is divided into smaller rectangles, with each one representing a different product category like "Electronics," "Furniture," and "Apparel." The size of each category's rectangle is proportional to its sales - so "Electronics," being the top seller, gets the biggest chunk of space.
That's the basic idea behind a treemap. It displays hierarchical data as a set of nested rectangles.
Here’s what defines it:
- Size: The size of each rectangle corresponds to a quantitative value you assign. For example, larger rectangles could represent higher revenue, more website visitors, or a greater number of units sold.
- Hierarchy: The larger rectangles (the main "branches" of your tree) can be further broken down into smaller rectangles (the "leaves"). This allows you to show part-to-whole relationships, like drilling down from a sales region to individual countries, or from a product category to specific items within it.
- Color: The color of each rectangle can be used to represent a second quantitative measure. For instance, you could size the rectangles by total sales and color them by profit margin - instantly showing you high-volume but low-profit items (big red rectangles) or small-volume but high-profit gems (small green rectangles).
Think of it as a more visual and compact way to understand the structure of your data compared to a series of pie charts. You get an immediate sense of which components are the most significant contributors to the whole.
When Should You Use a Treemap?
Treemaps are incredibly effective in specific situations where you need to display a lot of information in a limited space. They excel at showcasing parts of a whole and highlighting dominant categories.
Great Use Cases for a Treemap:
- Visualizing Hierarchical Data: This is the treemap’s bread and butter. If your data has a natural parent-child structure (e.g., Continents > Countries > Cities, or Product Departments > Categories > Sub-Categories), a treemap is an excellent choice.
- Comparing Proportions: It’s perfect for answering questions like, "Which product category contributes the most to our total revenue?" or "Which marketing campaign drove the most traffic?" The largest rectangle immediately draws your eye.
- Identifying Sales Concentration: You can quickly see where your sales are concentrated. Are 80% of your sales coming from just two product lines? A treemap makes this obvious without needing to read any numbers.
- Spotting Patterns Across Categories: By using color saturation, you can find patterns you might otherwise miss. For example, if you see an entire product category colored a deep red for low-profit margins, it signals a systemic issue with that category’s pricing or costs.
When to Avoid a Treemap
While useful, treemaps aren't a one-size-fits-all solution. In some cases, a different visual like a bar or column chart is more appropriate.
- When precise comparisons are needed: Humans are better at comparing the length of bars than the area of rectangles. If you need to know if "Category A" is exactly 5% larger than "Category B," a sorted bar chart is much clearer.
- When your data isn't hierarchical: If you're just comparing independent categories that don't roll up into a larger group, a treemap can be confusing. Stick to a bar chart.
- When you have negative values: Treemaps work by assigning area based on a value, so they cannot display negative numbers. If you need to show both profits and losses, a waterfall chart or bar chart is a better option.
- When there are too many small leaf nodes: If you have thousands of tiny sub-categories, your treemap can look like a cluttered mosaic of unreadable tiles. In this case, it might be better to group smaller items into an "Other" category or use a more suitable visual.
Step-by-Step: How to Create a Treemap in Power BI
Creating a treemap in Power BI is straightforward. Let’s walk through the process with a practical example. Say we have retail sales data containing the following fields: Product Category, Product Sub-Category, Sales Amount, and Profit Margin.
Step 1: Get Your Data Ready
First, ensure your data is loaded into your Power BI report. Your dataset should have at least one categorical field for the hierarchy (like Product Category) and one numerical field for the rectangle sizes (like Sales Amount).
Step 2: Select the Treemap Visual
In the Power BI report view, navigate to the Visualizations pane on the right-hand side. Click on the treemap icon. It looks like a set of nested rectangles. An empty treemap visual will appear on your report canvas.
Step 3: Add Your Data Fields
With the treemap visual selected, you’ll see several fields (or "wells") in the Visualizations pane. This is where you tell Power BI how to construct your chart. Here’s what each field does:
- Group: This is for your main, top-level category. The treemap will first be divided based on the data in this field. Drag your Product Category field here.
- Details: This is for the next level down in your hierarchy. Within each group, the chart will be further divided by the items in this field. Drag your Product Sub-Category field here.
- Values: This required field determines the size of each rectangle. It must be a numeric value. Drag your Sales Amount field here. You’ll immediately see your treemap take shape.
- Color saturation: This optional field adds another layer of insight. By default, rectangles are colored by their category. By adding a measure here, the intensity of the color will represent that measure's value. Drag your Profit Margin field here to color-code your display.
Step 4: A Practical Example Walkthrough
Let's put it all together. Using our retail data:
- Drag Product Category to the Group field. Your treemap will show three large rectangles: "Electronics," "Furniture," and "Apparel."
- Drag Sales Amount to the Values field. The rectangles will resize, with the largest one representing the category with the highest sales.
- Drag Product Sub-Category to the Details field. Now, each main category rectangle subdivides into smaller rectangles for sub-categories like "Phones," "Laptops," "Chairs," and "Tables."
- Drag Profit Margin to the Color saturation field. The chart colors will change, instantly signaling which sub-categories are the most and least profitable.
You’ve just created a multi-layered, insightful treemap. At a glance, you can see which sales categories are biggest and which sub-categories within them are most profitable.
Formatting Your Treemap for Maximum Clarity
A default visual is a good start, but a well-formatted one tells a much clearer story. Select your treemap and click the paintbrush icon ("Format your visual") in the Visualizations pane.
Data Labels
This is arguably the most important formatting option. By default, Power BI may hide the text labels inside smaller rectangles to avoid clutter.
- Toggle Data labels to On. This displays the value of the Details field (e.g., "Phones," "Chairs") inside each rectangle.
- You can adjust the font size, color, and display units (e.g., show sales in thousands 'K' or millions 'M') to improve readability.
Category Labels
These are the labels for the top-level Group categories.
- Toggle Category labels to On. This adds a bold heading for each main group ("Electronics," "Furniture"), making the hierarchy clearer.
- You can adjust the font and background of these labels to make them stand out.
Colors
Effective use of color can transform your treemap from a static chart to a dynamic analytical tool.
- Navigate to the Colors section. Here, you can define the color rules for the data in your Color saturation field.
- Click on the fx button to open the conditional formatting rules. You can set up a diverging color scale. For example:
Title and Borders
Don't neglect the basics. A good title provides context for your audience.
- Go to General > Title and change the default title (like "Sum of SalesAmount by ProductCategory and ProductSubCategory") to something clean and descriptive, like "Sales Performance by Category with Profit Margin."
- Under the Visual > Border section, you can add a border and adjust the spacing (gap) between the rectangles to make individual segments easier to distinguish.
Final Thoughts
The treemap in Power BI is a compact and visually effective way to represent hierarchical data and understand part-to-whole relationships. By configuring it to show not just size but also color based on performance, you can uncover valuable insights quickly. Mastering this visual will give you another powerful tool for telling clear, compelling stories with your data.
Building visuals in tools like Power BI is a valuable skill, but it often requires a lot of clicking, dragging, and formatting to get it just right. We created Graphed to remove this friction by letting you build dashboards using simple, natural language. Instead of navigating menus, you can just ask, "Show me a treemap of sales by category and sub-category," and get an interactive chart in seconds, connected directly to your live data from platforms like Shopify, Google Analytics, and Salesforce.
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.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?