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!