Forum Discussion
HELP: Matching a value in one column to a value from another column (but different row)
- 6 years ago
Hi Anonymous
Add custom columns
List.Contains(#"Removed Columns"[Person_ID],[Other_PersonID1]) or List.Contains(#"Removed Columns"[Person_ID],[Other_PersonID2])Replace #"Removed Columns" with the previous step in your case.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Add custom columns
List.Contains(#"Removed Columns"[Person_ID],[Other_PersonID1]) or List.Contains(#"Removed Columns"[Person_ID],[Other_PersonID2])
Replace #"Removed Columns" with the previous step in your case.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Thank you for this quick and detailed response.
I am struggling to apply this logic to my scenario.
I've implemented the following steps so I can get the same comparison as this scenario:
Created a new custom column:
= Table.AddColumn(#"Previous Step", "TrainingID", each if [Training] = true then [OrderID] else null)
Applied your logic to an additional custom column:
= Table.AddColumn(#"PreviousStep", "Training Order", each List.Contains(#"PreviousStep"[OrderID],[TrainingID])).
I was hoping this would check if the OrderID in each row existed somewhere in the TrainingID column, but it isn't doing this.
Any idea on where I am going wrong?