Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Reclassify according to a ranking

I need to group clients according to their income level. Only the top 10 clients will keep its name and the others will have "Others" instead of its name. Then, I need to show the income distribution of the clients in a Treemap visualization.

 

I managed to create a ranking as a Measure according to the income as it is shown in next Table (top 10 clients keep their company name, the others have "Others" instead of their company name). I used the following measures:

 

Ranking = rankx(all(Corredores[Empresa]),[Ingreso USD])
Company = if(Corredores[Ranking]>10, "Others", max(Corredores[Empresa]))
 

 

However, when I try to put this on a treemap Power Bi does not allow me to use the measure I created ('Company') as a Category, only as a Tooltip. Which does not allow me to create the figure a need to present. I need to accomplish a Treemap like this:

 

I do not understand if I am creating wrong the measure or if the treemap I need is not created like this.

2 Replies

  • HoangHugo's avatar
    HoangHugo
    Icon for Solution Specialist rankSolution Specialist

    Hi, I think you should put a field column into Category of Mapple Tree.

    • Anonymous's avatar
      Anonymous
      Not applicable

      But, when I try to make my variable "Company" as a column instead of a measure, it does not work with my formula: 

       

      Company = if(Corredores[Ranking]>10, "Others", max(Corredores[Empresa]))

       

      It only shows me the last/max value of "Empresa" which is a text variable.