Forum Discussion

kalyan209's avatar
kalyan209
Frequent Visitor
6 years ago
Solved

Comparing 2 columns

HI,

 

I am comparing 2 columns and displaying the required text in the new column using the specs below.

 

  • IF Doc Type = Observation THEN “Audit Report without Observation”
  • IF Doc Type = Audit AND TRN ID is in  Parent ID Field THEN “Audit Report with Observation”
  • IF Doc Type =Audit AND  TRN is not in Parent ID Field THEN “Audit Report without Observation”
 
 
 
From the image below i need to check if 148833 is present in PARENT_ID and display "Audits with observation". 
The formula i used is: 
 
Counts = IF('Audit and Obs Data'[DOC_TYPE] = "Observation", "Audit without Observation", IF('Audit and Obs Data'[DOC_TYPE]="Audit" && CONTAINS('Audit and Obs Data','Audit and Obs Data'[TRN_ID],'Audit and Obs Data'[PARENT_ID]), "Audit","Audits without Observation"))
  • kalyan209 you can containsrow function to find if TRN_ID exists in PARENT_ID or not

     

    Is Parent Exists = 
    CONTAINSROW( VALUES('Table'[Parent_Id] ), 'Table'[TRN_ID] )

     

3 Replies

  • kalyan209 you can containsrow function to find if TRN_ID exists in PARENT_ID or not

     

    Is Parent Exists = 
    CONTAINSROW( VALUES('Table'[Parent_Id] ), 'Table'[TRN_ID] )

     

    • parry2k's avatar
      parry2k
      Super User

      kalyan209 did you tried the formula? Put this new column in your table visual and you will find out if it is working or not.