Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Lookup values from another table

Hello folks 

 

I have 2 tables - Invoice & invoice received 

Invoice Table will have invoice and line items and invoice received will have invoices but without line item 

Invoice Line Item Vendor
15901  10     17850
15905  10     17800
15910  10     17810
15901  20     17850
15910  20     17810
15901  30     17850

15915  10     17642

 

ID            Reference Index
5F22A77 15901        1
5F22A77 15910        2
5F22A77 15901        3
5F22A77 15905        4

Need to identify the invoices present in invoice received and fetch the index value column. I tried using a column in the visualization with the function and was not succesful. 

Invoice_exist = LOOKUPVALUE(Invoice_recvd[Index],Invoice_recvd[Reference],Invoice[Invoice Number])
 
This resulted in an error : " A table of multiple values was supplied where a single value was expected."

 

Am i using this correct or is there a different option to lookup values . Basically i will have duplicate invoices in both tables which cannot be deleted. 

 

  • Hi Anonymous ,

     

    Sorry for our mistake, we can create a measure to get the releated index value and used it in other visual:

     

    Invoice_exist_DQ_Measure = 
    VAR I_Num = SELECTEDVALUE('Invoice'[Invoice Number])
    RETURN
    CALCULATE(
        MAX (Invoice_recvd[Index] ),
        Invoice_recvd[Reference] = I_Num
    )

     

    Or we can merge with the Recvd table and expand the index column

     

     

    Those should work on directquery mode.


    Best regards,

     

6 Replies