0
0
Power BIbi_tool~10 mins

Treemap in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a basic treemap visual in Power BI using the 'Category' field for grouping.

Power BI
Treemap = SUMMARIZE(Sales, Sales[[1]], "TotalSales", SUM(Sales[Amount]))
Drag options to blanks, or click blank then click option'
ACategory
BDate
CRegion
DCustomer
Attempts:
3 left
💡 Hint
Common Mistakes
Using a date field instead of a category for grouping.
Choosing a field that does not represent groups.
2fill in blank
medium

Complete the DAX measure to calculate total sales for the treemap visualization.

Power BI
Total Sales = CALCULATE(SUM(Sales[[1]]))
Drag options to blanks, or click blank then click option'
APrice
BQuantity
CDiscount
DAmount
Attempts:
3 left
💡 Hint
Common Mistakes
Summing quantity instead of amount.
Using a price or discount column incorrectly.
3fill in blank
hard

Fix the error in the DAX formula to calculate the percentage of total sales for each category in the treemap.

Power BI
Sales % = DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Sales[[1]])))
Drag options to blanks, or click blank then click option'
ADate
BCustomer
CCategory
DRegion
Attempts:
3 left
💡 Hint
Common Mistakes
Using ALL on a date or unrelated field.
Not removing the filter context correctly.
4fill in blank
hard

Fill both blanks to create a treemap that shows total sales by category and colors by region.

Power BI
TreemapVisual = SUMMARIZE(Sales, Sales[[1]], Sales[[2]], "TotalSales", SUM(Sales[Amount]))
Drag options to blanks, or click blank then click option'
ACategory
BRegion
CDate
DCustomer
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the grouping and color fields.
Using unrelated fields like Date or Customer.
5fill in blank
hard

Fill all three blanks to write a DAX measure that calculates sales only for the selected category and region in the treemap.

Power BI
Filtered Sales = CALCULATE(SUM(Sales[[1]]), FILTER(Sales, Sales[[2]] = SELECTEDVALUE(Sales[[2]]) && Sales[[3]] = SELECTEDVALUE(Sales[[3]])))
Drag options to blanks, or click blank then click option'
AAmount
BCategory
CRegion
DDate
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the filter columns.
Using Date instead of Category or Region.