Forum Discussion
Anonymous
6 years agoNot applicable
Conditional formatting multiple columns by text value
Objective: Change background color using a HEX color code based on cell value for columns PBar_01 to PBar_14. My current solution involves creating 14 measures for each column then use conditional f...
amitchandak
6 years agoSuper User
Anonymous , You can create a color measure than return color based on condition and use that with "Field" option in conditional formatting
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
- alexjoukova3 years agoNew Member
But how can this measure be applied to each column? What is Table[Commodity] and Table[Value]? I need to appy conditional formatting based on the value in the specific cell, for each column.