Forum Discussion
Help with Heatmap in a matrix visual
- 5 years ago
Two comments:
You can simplify your logic like this
Maturity color = SWITCH(SELECTEDVALUE(years[maturity]),"2" , "#AED6F1","1" , "#85C1E9","#5DADE2")But this will still not help you with the cells where there is no "SELECTEDVALUE" (missing data). For that you may need to create dummy data points (via a cross join) or use a fake matrix background color set to #5DADE2.
Hi Lwhal,
Perhaps another quick option would be to use the Conditional Formatting option on both the % and Maturity columns and use the Diverging setting to get your three specific colors (btw - I think the color codes may be off from what is seen on screen), I just used three quickly selected blues in the attached PBIX example.
Select your matrix and under formatting (paintbrush) open the Conditional Formatting options:
Select the % field and turn the background color to ON, then click the Advanced Controls, and a new pop-up will be displayed:
For your example given you only have 3 values, you really could just use the Lowest and Highest settings at 0 and 2, respectively, but since you want to control the three colors, click on the Diverging checkbox.
In the three drop-downs, change the values (lowest, middle, highest) to Custom, and you will be able to enter your 0, 1, and 2. Set your colors to your choosing.
Based on your request to keep the blanks in the dark blue, make sure to keep in the Advanced setting, keep the Default formatting set to "As zero". If you wanted those a different color, you can control it there.
Click OK to apply these changes to the % columns and then select the Maturity field, and repeat the steps for the conditional formatting for those columns.
Let me know if you want a sample PBIX to review...I hope this helps and Happy Holidays!