Forum Discussion

rohitMe's avatar
rohitMe
Advocate I
8 years ago
Solved

Lookup fucntion

Hi all,   I want to know whether I can perform a lookup in a table in the following way:   -All the values I want to search are listed in one column(Note: I want to search multiple values using o...
  • Stachu's avatar
    Stachu
    8 years ago

    this will give all the customer Ids

    Customer Id 2 =
    VAR CurrentMobileNr = Table1[Customer Mobile]
    RETURN
        CALCULATE (
            CONCATENATEX ( Table2, Table2[Customer Id], "," ),
            Table2[Customer Mobile] = CurrentMobileNr
        )

    EDIT
    no duplicates version

    Customer Id 2 =
    VAR CurrentMobileNr = Table1[Customer Mobile]
    VAR NoDuplicates =
        FILTER (
            SUMMARIZE ( Table2, Table2[Customer Mobile], Table2[Customer Id] ),
            Table2[Customer Mobile] = CurrentMobileNr
        )
    RETURN
        CONCATENATEX ( NoDuplicates, [Customer Id], "," )