Forum Discussion
kalyan209
6 years agoFrequent Visitor
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] )