Forum Discussion

visitprateek's avatar
visitprateek
Frequent Visitor
6 years ago
Solved

Replacing part data in a table in another table

Hello

I want to replace some values in table 1 of table 2 depending on the invoice no. for example;

Table 1
Invoice dateInvoice No.Amount
01-01-2020GOOD-01100
02-02-2020GOOD-02200
03-02-2020RAJ-03300
04-02-2020GOOD-05400
05-02-2020GOOD-09600
31-03-2020RAJ-10900

Table 2
Invoice dateOriginal invoice number.New bill No.Revised amount
01-01-2020GOOD-01GOOD-06100
04-02-2020GOOD-05GOOD-10500
05-02-2020GOOD-09GOOD-111000
31-03-2020RAJ-10RAJ-15900

In the example above, I want there to be no new invoice. and the amount reviewed in Table 1 when there is a change in the original invoice.

Reqult required as follows:

Result required
Invoice dateNot the correct invoice.Amount
01-01-2020GOOD-06100
02-02-2020GOOD-02200
03-02-2020RAJ-03300
04-02-2020GOOD-10500
05-02-2020GOOD-111000
31-03-2020RAJ-15900

Please lead.

Thank you.

Best regards

Prateek

  • visitprateekYou can use LOOKUPVALUE to retrieve the revised invoice number and amount, if any available to build columns in the first table. Then use the new columns in your visuals.

     

    For example:

    Invoice No New = LOOKUPVALUE(Table2[New bill No.], Table2[Original invoice number.], Table1[Invoice No.])
    Invoice No Final = IF(ISBLANK(Table1[Invoice No New]), Table1[Invoice No.], Table1[Invoice No New])
    Amount New = LOOKUPVALUE(Table2[Revised amount], Table2[Original invoice number.], Table1[Invoice No.])
    Amount Final = IF(ISBLANK(Table1[Amount New]), Table1[Amount], Table1[Amount New])
     

2 Replies

  • visitprateekYou can use LOOKUPVALUE to retrieve the revised invoice number and amount, if any available to build columns in the first table. Then use the new columns in your visuals.

     

    For example:

    Invoice No New = LOOKUPVALUE(Table2[New bill No.], Table2[Original invoice number.], Table1[Invoice No.])
    Invoice No Final = IF(ISBLANK(Table1[Invoice No New]), Table1[Invoice No.], Table1[Invoice No New])
    Amount New = LOOKUPVALUE(Table2[Revised amount], Table2[Original invoice number.], Table1[Invoice No.])
    Amount Final = IF(ISBLANK(Table1[Amount New]), Table1[Amount], Table1[Amount New])