Forum Discussion
Color coding with DAX
- 4 years ago
Hi,
This happens to me all the time. And everytime it's because I forgot the change the type of the measure that returns the color codes. It defaults to "number" even when your formula returns a text. You have to force it to "text". Then it wont be disable/gray-out anymore in the field pick-list.
--mo
Hey @anonymous & Seward12533,
I was facing the same issue and was able to fix it.
how did I fix?
I changed the data type to TEXT of the measure which changes the color.
Below is the measure I used to change the color. by default the data type of this measure was decimal. so it was not working.
I guess the logic behind this is, we are returning a HEX code which is in TEXT format. so if the data type is decimal it will not work but if it is TEXT it will work.
Triangle Color =
SWITCH(
TRUE(),
[Amt] > 1000, "#00d600",
[Amt] < 1000, "#d60000"
)