Forum Discussion

Camstr's avatar
Camstr
Helper I
1 year ago
Solved

Highlight where text data is not matching

Hello,

Please see attached screenshot.

I'd like to compare text from two different data sources and conditionally format to highlight where data does not match exactly.

I would prefer not to introduce an additional column.

How would I do this?

 

  • Hi Camstr

     

    You don't need to add a new column to the visual, you just need to use the measure on the conditional formatting of one of the tt columns or on both. Select the measure on the conditional formatting rules.and set the value equal to 1

  • Hi Camstr  try the following code..

     

    Registration check =IF( SELECTEDVALUE (Table[Registration Number 2]) <>BLANK() & & SELECTEDVALUE (Table[Registration Number 1]) <> SELECTEDVALUE (Table[Registration Number 2]), 1)

     

     

6 Replies

  • Hi Camstr ,

     

    Is the information stored in the same table or are you having the data in different tables? how is the information related?

     

    If you have any kind of relationship between both of them and you are using it in a visual you can add a measure similar to this:

    Registration Check = IF(SELECTEDVALUE(Table[Registration Number 1]) <> SELECTEDVALUE(Table[Registration Number 2]), 1)

    Now add a condittional formatting rule were this measure equals 1 to get the background or text in a red or other colour. 

    • Camstr's avatar
      Camstr
      Helper I

      Hi Miguel, that's awesome thank you!

      The data is stored in different tables and is related through another common identifier.

      Your solution works nicely, but it does mean an extra column in my table (for the measure).

      I guess that is unavoidable in PBI for text?

       

      Cam

      • MFelix's avatar
        MFelix
        Super User

        Hi Camstr

         

        You don't need to add a new column to the visual, you just need to use the measure on the conditional formatting of one of the tt columns or on both. Select the measure on the conditional formatting rules.and set the value equal to 1

  • MFelix if 'Registration Number 2' is blank then I do not want it to record a mismatch (i.e. 1).  How would I edit the measure to ignore blanks?  Thanks in advance.

    Registration Check = IF(SELECTEDVALUE(Table[Registration Number 1]) <> SELECTEDVALUE(Table[Registration Number 2]), 1)

     

    • MFelix's avatar
      MFelix
      Super User

      Hi Camstr  try the following code..

       

      Registration check =IF( SELECTEDVALUE (Table[Registration Number 2]) <>BLANK() & & SELECTEDVALUE (Table[Registration Number 1]) <> SELECTEDVALUE (Table[Registration Number 2]), 1)