Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi All,
I’m trying to apply conditional formatting on a Treemap visual in Power BI.
The requirement is to have two different color palettes applied dynamically based on the number of departments shown in the visual. Currently, I’m using the gradient option, where I can only define a single min → max color range.
However, I need the first half of the departments to follow one palette (e.g., Purple: #D0AAF0 → #2C0440
) and the second half to follow another palette (e.g., Blue: #E1EBFF → #00297A
).
Since the number of departments can grow (e.g., 20 today, 40 tomorrow), the logic should remain dynamic.
Is there any workaround or approach to achieve this in a single Treemap visual?
Solved! Go to Solution.
Hi @AnkitaaMishra ,
This is not an easy setup since you want to do a gradient and need to setup the gradient values.
Check this video with some advance DAX for colouring:
https://www.youtube.com/watch?v=c2mZimSeEL4
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix ,This is exactly what I was looking for! I created a DAX measure using HSLA colors, ranked the departments, and it worked perfectly. Huge thanks for sharing the solution! 🙂
Hi @MFelix ,This is exactly what I was looking for! I created a DAX measure using HSLA colors, ranked the departments, and it worked perfectly. Huge thanks for sharing the solution! 🙂
Hi @AnkitaaMishra ,
This is not an easy setup since you want to do a gradient and need to setup the gradient values.
Check this video with some advance DAX for colouring:
https://www.youtube.com/watch?v=c2mZimSeEL4
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português