Hi there
I am keen to know if there is a way to do conditional formatting based on a text field. For example:
SCORE COLOUR
Good = Green
Fair = Yellow
Poor = Red
Thank you
Steve
Hi there
I am keen to know if there is a way to do conditional formatting based on a text field. For example:
SCORE COLOUR
Good = Green
Fair = Yellow
Poor = Red
Thank you
Steve
Welcome to the Forum!
Please check out this video by Sam
It is possible to use colour names in DAX for conditional formatting. Youâll have to create some logic using a SWITCH statement, like in this example.
Colour =
SWITCH( TRUE(),
TestValue = "Good", "Geen"
TestValue = "Fair", "Yellow"
TestValue = "Poor", "Red"
)
And hereâs an overview of colour names that are supported in Power BI:
To add to Melissaâs response. You can also add the Hex# instead of using the name of the color. Here is what her SWITCH statement would look like after you apply the Hex#:
Colour =
SWITCH (
TRUE (),
TestValue = "Good", "#228c22",
TestValue = "Fair", "#ffff00",
TestValue = "Poor", "#cc2222",
BLANK ()
)
Then you can go into conditional formatting and format by âField Valueâ.
Here is another post with a similar topic that may be of help as well:
Thank you so much Melissa. Very impressed with how quickly my very first forum post was replied to
Youâre welcome Floyd
And please donât forget if your question has been answered within the forum it is important to mark your thread as âsolvedâ.
Thanks!
@Floyd, Hi and welcome.
You can also use uni-code symbols direct in DAX too⌠ie. ââ bad or ââ good.