Forum Discussion
Conditional Formatting to highlight columns with mismatched values
I have two columns of data; I'd like to apply conditional formatting to values that match and values that don't.
The State column is called from a table called ReportTable.
The Issue_State column is called from a table called Issues.
I'd like to set background colour to green on all matching values in both columns, and red/orange for all mismatched values.
When any columns display matching values of CLOSED or DEFERRED, I'd like to remove those rows from the table entirely.
Hi EMN
According to the colors you can use a measure like :color = if(SELECTEDVALUE('Issues'[State])=SELECTEDVALUE('ReportTable'[Issue_State]),"Green","Red" )
and apply this measure for all the columns that you needResult after applying for all the columns
You can use hexa codes instead of color names :
My recommendation from an effective visualization perspective is to highlight only what is "not correct." This approach reduces cognitive load, as red will always stand out much more against white compared to other colors. The purpose of colors is to alert where improvement is needed 🙂
According to the filtering you can create flag measures like :
filter =var state = SELECTEDVALUE('Issues'[State])var issue_state = SELECTEDVALUE('ReportTable'[Issue_State])RETURNif (state IN {"closed","Defered"} || issue_state IN {"closed","Defered"} , 0,1)And use it as a visual filter :
Result :
PBIX is attached
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Ritaf1983
Super User
Hi EMN
According to the colors you can use a measure like :color = if(SELECTEDVALUE('Issues'[State])=SELECTEDVALUE('ReportTable'[Issue_State]),"Green","Red" )
and apply this measure for all the columns that you needResult after applying for all the columns
You can use hexa codes instead of color names :
My recommendation from an effective visualization perspective is to highlight only what is "not correct." This approach reduces cognitive load, as red will always stand out much more against white compared to other colors. The purpose of colors is to alert where improvement is needed 🙂
According to the filtering you can create flag measures like :
filter =var state = SELECTEDVALUE('Issues'[State])var issue_state = SELECTEDVALUE('ReportTable'[Issue_State])RETURNif (state IN {"closed","Defered"} || issue_state IN {"closed","Defered"} , 0,1)And use it as a visual filter :
Result :
PBIX is attached
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- EMNRegular Visitor
I just realised I never said thank you! This worked perfectly, and took your advice for only showing the reds 🙂