Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Treemap coloring by category

Hi everyone.

 

I have treemap with data, item and category, where each item has two categories and data for categories. It looks like this:

I wanted to color by category, but in data colors there is no such options.

How I can color by category, so cat1 will be blue and cat2 will be yellow?

 

Regards,

Yerkhan

  • Hi Anonymous 

     

    Here is a solution that may work for you.

     

    It involves a couple of things and doesn't keep the treemap formatted exactly as intended but it may be a small compromise if the shading is important. 

     

    In the solution below, you keep item and category grouped under Group and then expand one level in the hierarchy in the visual ( the double arrow pitchfork icon). You need to have a column created which strips the Category from the Category name and create an advanced controls rule which controls the colour fill. I just used min 1 and max 2 , but if you have multiple categories you can use rules-based formatting too.

     

    Bear in mind the advanced controls is not available with any field in the Details section 

    Here are the steps:

     

     

    Cheers

     

    Manfred

     

     

     

     

     

11 Replies

  • Hi Anonymous 

     

    Here is a solution that may work for you.

     

    It involves a couple of things and doesn't keep the treemap formatted exactly as intended but it may be a small compromise if the shading is important. 

     

    In the solution below, you keep item and category grouped under Group and then expand one level in the hierarchy in the visual ( the double arrow pitchfork icon). You need to have a column created which strips the Category from the Category name and create an advanced controls rule which controls the colour fill. I just used min 1 and max 2 , but if you have multiple categories you can use rules-based formatting too.

     

    Bear in mind the advanced controls is not available with any field in the Details section 

    Here are the steps:

     

     

    Cheers

     

    Manfred

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi mwimberger 

       

      Thanks for your answer.

      Unfortunately, this doesn't quite works for me.

      So, it is not possible to color with details present and make color by details, right?

       

      Regards,

      Yerkhan

    • k-squared2's avatar
      k-squared2
      New Member

      Thanks, mwimberger, this worked for me. It's a bit frustrating that the Power BI user interface for the Treemap visual makes it so difficult to apply a simple color gradient though. 

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi, Anonymous 

    If you may try to exchange the item and category locations for Treemap.

    Before

     

    Best Regards,

    Lin