Forum Discussion

inglexjc's avatar
inglexjc
Post Patron
1 year ago
Solved

Color formatting when text in two different columns are different.

Need to use color to show when text in 2 separate columns are different.  Example if Initial Ruling shows "Dismissed" but Final Ruling shows "Not Decided".  But other words could be used.   Init...
  • Greg_Deckler's avatar
    1 year ago

    inglexjc You could create a calculated column like the following and base the conditional formatting on it's value:

    Column = IF( [Initial Ruling] = [Final Ruling], 1, 2 )

    In PQ:

    = if [Initial Ruling] = [Final Ruling] then 1 else 2
  • danextian's avatar
    1 year ago

    hi inglexjc , You could create a conditional formatting measure:

    Conditional Formatting Color = 
    IF (
        SELECTEDVALUE ( tbl[Initial Ruling (SLH)] )
            <> SELECTEDVALUE ( tbl[Final Ruling] ),
        "Red",
        "Yellow"
    )
    --you may use any other color Power BI can interpret but a safer method is to use RGB, RGBA or Hexadecimal colors

    Note: SELECTEDVALUE returns blank if in the current row there are more than one values for the column being referenced so ensure to use a column that will return just a single ruling value for each ruling column (like a case number, etc).

     

  • danextian's avatar
    danextian
    1 year ago

    you created a column instead of a  measure.