Forum Discussion

JoaoLourenco's avatar
JoaoLourenco
New Member
2 years ago
Solved

Find text in different columns and different tables

Good afternoon,   I would like help with the following:   1.I want to know if the data from the [Registration] field in the 'Vehicles' table is found in the [Asset Elements Description] field in ...
  • muhammad_786_1's avatar
    2 years ago

    You can create a new calculated column in Table 1 that checks whether the [ID_Matr] in Table 1 exists in the [Designation] column of Table 2.

    Steps:

    1- Navigate to the "Data" view.

    2- Select Table 1 where you want to create the new calculated column.

    3- Create a new column by clicking on "New Column".

    4- Enter the following DAX formula:

    ExistsInTable2 =
    IF(
    COUNTROWS(
    FILTER(
    'Table 2',
    SEARCH('Table 1'[ID_Matr], 'Table 2'[Designation], 1, 0) > 0
    )
    ) > 0,
    "YES",
    "NO"
    )

    5- Now, new column ExistsInTable2 will now show "YES" if the [ID_Matr] exists in [Designation] of Table 2 otherwise "NO".