Forum Discussion
Anonymous
8 years agoNot applicable
Conditional formatting for a text column
Hi PBI community, Is there a way to change the background or font color of a table cell for a text based column using DAX. Any help would be appreciated. Thank you!
mh2587
4 years agoSuper User
You can use it with switch function and color codes
XYZ Color = SWITCH(TRUE(),
XYZ Color = SWITCH(TRUE(),
X < 0,"#FF0000",
Y = 0, "#FFFF00",
Z >0, "#00FA9A",
"#00FA7A" )
Anonymous
4 years agoNot applicable
This method works perfectly in the Sept. 2021 version. Simply create a Calculated Column based on the original column using the method above (Hex color codes). Then do conditional formattting on the original field in a table or matrix and pick "Format by" > "Field value", "Based on field" > Your calculated column.