cancel
Showing results for
Did you mean:
Helper V

## If column contains values from column in another table...

Hello

I would like a column that shows whether or not a column in Table2 contains values that are in Table1.

 Table1 Value New Column A TRUE B FALSE C TRUE D FALSE E TRUE
 Table2 Value A C E

Any Ideas?

Thanks!

2 ACCEPTED SOLUTIONS
Solution Sage

Hi @bullius. If table 2 contains only unique values, you could relate the two tables on the Value column, and then use this formula for your New Column:

`New Column = NOT(ISBLANK(RELATED(Table2[Value])))`

You can also use the formula below, which will work with or without the relationship:

`New Column = CALCULATE(COUNTROWS(Table2), FILTER(Table2, Table2[Value]=Table1[Value])) > 0`

Impactful Individual

I know KGrice's formula worked but it does seem a tad clunky... you could consider this as a slightly cleaner alternative (since the CONTAINS function exists exactly for this purpose):

Column = CONTAINS(Table2, Table2[Value], Table1[Value])

7 REPLIES 7
Solution Sage

Hi @bullius. If table 2 contains only unique values, you could relate the two tables on the Value column, and then use this formula for your New Column:

`New Column = NOT(ISBLANK(RELATED(Table2[Value])))`

You can also use the formula below, which will work with or without the relationship:

`New Column = CALCULATE(COUNTROWS(Table2), FILTER(Table2, Table2[Value]=Table1[Value])) > 0`

Helper V

Table2 does not contain unique values...

Solution Sage

Hi @bullius. The unique values piece only matters for creating a relationship. The second option I listed does not require unique values in either table. Were you able to get that one working?

Helper V

Yes! The second one does the job. Thanks!

Impactful Individual

I know KGrice's formula worked but it does seem a tad clunky... you could consider this as a slightly cleaner alternative (since the CONTAINS function exists exactly for this purpose):

Column = CONTAINS(Table2, Table2[Value], Table1[Value])

Anonymous
Not applicable

but with this method, there has to be a relationship established between tables, right ?

Solution Sage

Thanks, @jahida. I hadn't come across the CONTAINS function yet. I'll start using that instead.

Announcements

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.