Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

lookup values based on two columns

Hi Gurus, 

 

I have two tables, I want a new column in tabel one looking up ID and Rev on Tabel 2 get the value of the Completed column in to the Tabel 1 

  • Anonymous 

    Pleae try:

    Result = LOOKUPVALUE('Table2'[Completed], 'Table2'[ID], 'Table1'[ID],
    'Table2'[Rev], 'Table2'[Rev])

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS 🙂

    YouTube, LinkedIn

4 Replies

  • Anonymous 

    Pleae try:

    Result = LOOKUPVALUE('Table2'[Completed], 'Table2'[ID], 'Table1'[ID],
    'Table2'[Rev], 'Table2'[Rev])

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS 🙂

    YouTube, LinkedIn

    • Anonymous's avatar
      Anonymous
      Not applicable

      Fowmy, Thanks champion. it works. 

       

      so if its even for more columns you can still give the combination ? means say we have three columns matching from both tabels, 

       

      does column names have to be in an order.

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 

        Yes, sure:

        this is the syntax:

         LOOKUPVALUE(
        <result_columnName>,
        <search_columnName>,
        <search_value>
        [, <search2_columnName>, <search2_value>]…
        [, <alternateResult>]
        )

        ________________________

        Did I answer your question? Mark this post as a solution, this will help others!.

        I accept KUDOS 🙂

        YouTube, LinkedIn

  • Anonymous , Try new column like in Table 1

    new COlumn = minx(filter(table2,Table2[ID]=Table1[ID]),Table2[Completed])

     

    In case table2 -> Table1 is 1 to M join

    new COlumn =related(Table2[Completed])