This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi
I have a column in a table visual which I want to color based upon the value. So the values are text and there are only three uniqe possiblities and i want to give each option a Green, Red or a Gray color.
I already checked the conditional formatting option but that is around a numeric value but not text.
Any clues as to how to do it efficiently?
Thanks
Solved! Go to Solution.
@Anonymous
You need to write a measure to read the value of the cell then return the name of the color.
Formatting =
VAR _Value = SELECTEDVALUE ( 'Table'[Value] )
RETURN
SWITCH (
_Value,
"West","Green",
"Central","Gray",
"East","Red"
)
You would change West, Central, East to match your values.
Then you apply conditional formatting to the column > font color based on the Field value of the [Formatting] measure.
I attached a sample file for you to take a look at.
Hi,
My approach is this: go to dimension where you have a field based on which you would like to set background color.
Add new column which sets color based on specific criteria (or add that column in source).
Example:
Then select table and add conditional formatting to desired field:
Define logic:
And this is final result:
Cheers,
Nemanja
@Anonymous
You need to write a measure to read the value of the cell then return the name of the color.
Formatting =
VAR _Value = SELECTEDVALUE ( 'Table'[Value] )
RETURN
SWITCH (
_Value,
"West","Green",
"Central","Gray",
"East","Red"
)
You would change West, Central, East to match your values.
Then you apply conditional formatting to the column > font color based on the Field value of the [Formatting] measure.
I attached a sample file for you to take a look at.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 25 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 24 | |
| 20 | |
| 20 | |
| 19 | |
| 19 |