Bird
Raised Fist0
Power BIbi_tool~15 mins

Treemap in Power BI - Real Business Scenario

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants a visual summary of sales by product category and subcategory to quickly see which areas contribute most to revenue.
📊 Data: You have sales data including Product Category, Product Subcategory, and Sales Amount for the last quarter.
🎯 Deliverable: Create a treemap visualization in Power BI that shows sales by category and subcategory.
Progress0 / 7 steps
Sample Data
Product CategoryProduct SubcategorySales Amount
ElectronicsPhones15000
ElectronicsComputers22000
ElectronicsAccessories8000
ClothingMen12000
ClothingWomen18000
ClothingKids7000
HomeFurniture14000
HomeKitchen9000
HomeDecor6000
1
Step 1: Load the sales data into Power BI Desktop.
Use 'Get Data' > 'Excel/CSV' or paste data directly.
Expected Result
Sales data table appears in Power BI with columns: Product Category, Product Subcategory, Sales Amount.
2
Step 2: Create a new measure to sum Sales Amount.
Total Sales = SUM('SalesData'[Sales Amount])
Expected Result
Measure 'Total Sales' calculates total sales correctly.
3
Step 3: Insert a Treemap visual on the report canvas.
From Visualizations pane, select 'Treemap'.
Expected Result
Blank treemap visual appears on the report.
4
Step 4: Add 'Product Category' to the Group field of the treemap.
Drag 'Product Category' column to 'Group' in treemap fields.
Expected Result
Treemap shows main blocks for each product category.
5
Step 5: Add 'Product Subcategory' to the Details field of the treemap.
Drag 'Product Subcategory' column to 'Details' in treemap fields.
Expected Result
Treemap subdivides each category block into subcategory blocks.
6
Step 6: Add the 'Total Sales' measure to the Values field of the treemap.
Drag 'Total Sales' measure to 'Values' in treemap fields.
Expected Result
Block sizes in treemap reflect sales amounts.
7
Step 7: Format the treemap for clarity: enable data labels and adjust colors for contrast.
In Format pane, turn on 'Data labels' and choose accessible colors.
Expected Result
Treemap shows sales values on blocks with clear color differences.
Final Result
Treemap Visualization

+-----------------------------+
| Electronics                 |
|  +---------+  +---------+   |
|  | Phones  |  |Computers|   |
|  | $15k    |  | $22k    |   |
|  +---------+  +---------+   |
|  +------------+             |
|  |Accessories | $8k         |
+-----------------------------+
| Clothing                   |
|  +-------+  +-------+  +---+|
|  | Men   |  | Women |  |Kids|
|  | $12k  |  | $18k  |  |$7k |
|  +-------+  +-------+  +---+|
+-----------------------------+
| Home                      |
|  +---------+  +------+  +--+|
|  |Furniture|  |Kitchen| |Decor|
|  | $14k   |  | $9k   | |$6k |
|  +---------+  +------+  +--+|
+-----------------------------+
✓Computers in Electronics category have the highest sales at $22,000.
✓Women's clothing sales are strong at $18,000, leading the Clothing category.
✓Home Furniture sales are significant at $14,000 compared to other Home subcategories.
Bonus Challenge

Add a slicer to filter the treemap by Product Category so the manager can focus on one category at a time.

Show Hint
Use the 'Slicer' visual and add 'Product Category' to its field. Connect slicer to the treemap.

Practice

(1/5)
1. What is the main purpose of a Treemap visualization in Power BI?
easy
A. To list data in rows and columns
B. To display data as a line over time
C. To show parts of a whole using size and color
D. To create a map with geographic locations

Solution

  1. Step 1: Understand Treemap visualization

    A Treemap shows data as nested rectangles where size and color represent values.
  2. Step 2: Compare options to definition

    Only To show parts of a whole using size and color describes showing parts of a whole using size and color, which matches Treemap.
  3. Final Answer:

    To show parts of a whole using size and color -> Option C
  4. Quick Check:

    Treemap = parts of whole with size and color [OK]
Hint: Treemap = parts of whole shown by size and color [OK]
Common Mistakes:
  • Confusing Treemap with line chart
  • Thinking Treemap is a table
  • Mixing Treemap with map visual
2. Which fields should you add to a Treemap visual in Power BI to show category sizes correctly?
easy
A. Add 'Group' to Tooltip and 'Values' to Axis
B. Add 'Group' to Values and 'Values' to Legend
C. Add 'Values' to Group and 'Group' to Values
D. Add 'Group' to Group and 'Values' to Values

Solution

  1. Step 1: Recall Treemap field roles

    Treemap uses 'Group' for categories and 'Values' for size of rectangles.
  2. Step 2: Match fields to correct roles

    Add 'Group' to Group and 'Values' to Values correctly assigns 'Group' to Group and 'Values' to Values, which is required.
  3. Final Answer:

    Add 'Group' to Group and 'Values' to Values -> Option D
  4. Quick Check:

    Group = Group, Values = Values [OK]
Hint: Group goes to Group, Values goes to Values in Treemap [OK]
Common Mistakes:
  • Swapping Group and Values fields
  • Putting Values in Legend or Axis incorrectly
  • Using Tooltip instead of Group or Values
3. Given a dataset with categories and sales amounts, what will a Treemap show if one category has sales 500 and another 1000?
medium
A. The category with 1000 sales will have a rectangle twice as large as the 500 sales category
B. Both categories will have rectangles of the same size
C. The category with 500 sales will have a rectangle twice as large as the 1000 sales category
D. The Treemap will only show color differences, not size

Solution

  1. Step 1: Understand Treemap size representation

    Treemap rectangle size is proportional to the value it represents.
  2. Step 2: Compare sales values

    1000 is twice 500, so the rectangle for 1000 sales will be twice as large as for 500 sales.
  3. Final Answer:

    The category with 1000 sales will have a rectangle twice as large as the 500 sales category -> Option A
  4. Quick Check:

    Size ∝ Value, so 1000 sales rectangle is twice 500 sales [OK]
Hint: Rectangle size matches value proportionally in Treemap [OK]
Common Mistakes:
  • Thinking smaller value has bigger rectangle
  • Assuming rectangles are same size
  • Believing Treemap uses only color, not size
4. You created a Treemap but all rectangles appear the same size despite different values. What is the most likely cause?
medium
A. You added the 'Group' field to Values instead of 'Values'
B. You used a stacked bar chart instead of Treemap
C. You forgot to add any fields to the visual
D. You added 'Values' to Group and 'Group' to Values

Solution

  1. Step 1: Analyze field placement impact

    Adding 'Group' to Values means Power BI treats categories as numeric values, causing equal sizes.
  2. Step 2: Identify correct field usage

    Values field must be numeric data for size; Group is categorical and should not be in Values.
  3. Final Answer:

    You added the 'Group' field to Values instead of 'Values' -> Option A
  4. Quick Check:

    Wrong field in Values causes equal rectangle sizes [OK]
Hint: Ensure numeric field is in Values, not Group [OK]
Common Mistakes:
  • Swapping Group and Values fields
  • Using wrong visual type
  • Leaving fields empty
5. You want to create a Treemap showing sales by product category and highlight categories with sales above 1000 in a different color. How can you achieve this in Power BI?
hard
A. Add 'Sales' to Group and 'Group' to Values, then filter categories with sales > 1000
B. Add 'Group' to Group, 'Sales' to Values, and create a measure with conditional color formatting based on sales > 1000
C. Use a stacked bar chart instead and apply color rules
D. Add 'Group' to Tooltip and 'Sales' to Legend without conditional formatting

Solution

  1. Step 1: Set up Treemap fields correctly

    Add 'Group' to Group for categories and 'Sales' to Values for size representation.
  2. Step 2: Apply conditional color formatting

    Create a measure that returns different colors based on sales > 1000, then use it in color formatting.
  3. Final Answer:

    Add 'Group' to Group, 'Sales' to Values, and create a measure with conditional color formatting based on sales > 1000 -> Option B
  4. Quick Check:

    Correct fields + conditional color measure = desired Treemap [OK]
Hint: Use conditional color measure with correct fields in Treemap [OK]
Common Mistakes:
  • Swapping Group and Values fields
  • Not using conditional formatting for color
  • Choosing wrong visual type
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard