Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Treemap summarization of a quick measure



I'm trying to use a Treemap for showing average values from a quick measure for a category and its details. However, it seems that the Treemap is sorting the category over the sum of the averages of each detail instead of the averages overall.


My Treemap looks like this:



My quick measure looks like this:

AverageWorkingHours =
    SUM('FactCampusQtdDocentes'[Quantidade Docentes])
FactCampusCH looks like this:


FactCampusQtdDocentes looks like this:




I noticed that each category block (e.g. campuses CTC, CCS, CFH, CCS, etc.) is sorted over the sum of each of their details (average working hours of Departments) but I wanted the biggest average to appear first and not the biggest sum. This makes it seems that "CTC" has bigger average working hours than "CTE" (because CTC has more Departments, making the sum of its averages bigger than CTE), which is not true.



If I take the details off, the Treemap looks (correctly) like this (CTE first, CDS second, etc.):



I wanted to maintain this correct order with the details. But once I put on the details the Treemap changes the ordering 😞


Any ideas on how can I achieve this?




Super User
Super User

@nathaliaalves , Tree Map does not support the sort option. The usual trick is to add a tooltip and sort of that

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Sorry, I didn't quite understand. I don't want to "sort", I just want the order of the category "blocks" to be based on the average and not the sum of the details.

Helpful resources


2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.