Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
Solved! Go to Solution.
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
hi, @Anonymous
If you may try to exchange the item and category locations for Treemap.
Best Regards,
Lin
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
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.
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
Hi @Anonymous
That right - as soon as you add a field to the details section , the advanced color formatting in Data Colors isn't available.
Another solution may be to use the Treemap Bar Chart custom visual from MAQ Software available in the marketplace or here https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA200000043?src=office&tab=Overview
Hi @Anonymous
Or you can try it this way...which might be exactly what you are after?
Hi @Anonymous
So adding a border only adds a border to the visual outline. This is different to the MS Excel Treemap which adds a border to the items and you can adjust the thickness of these. (Maybe suggest this as an idea at ideas.powerbi.com)
I tried a couple of things - the only thing that made a bit of a difference was changing background colour - which changed it only marginally using a black background. Here are some examples.
So the built in tree map is not that customisable 😥.
Not sure whether you want to bake your own, or find other customisable ones ( there is a great list here: https://www.visualisingdata.com/resources/ with https://www.treemap.com offering an API or desktop version at a cost). Charticulator https://charticulator.com/index.html (which I mentioned earlier I think) has the following to say in its white paper https://donghaoren.org/publications/infovis18-charticulator.pdf :....." Besides, we can further extend Charticulator’s expressive range by supporting additional specialized layout algorithms (e.g., treemap and force-directed graph layout)". Not sure if that means it is still coming in a future release.
Hope this helps.
Cheers and have an awesome day
Manfred
Hope I have been able to help in some small way
Thanks for your reply.
This approach doesn't quite work for me.
Are there any other tree map visuals? Besides regular tree map and bar charted tree map?
Regards,
Yerkhan
@Anonymous There is a Mekko Chart which does adjust the width of the bars based on a field.
https://powerbi.microsoft.com/en-us/blog/visual-awesomeness-unlocked-mekko-chart/
https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa104380785
Here is an example with the data I used for the other tree maps.
Or if that isn't up your alley you can look at baking your own - here is a great site: https://charticulator.com/