Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
visitprateek
Frequent Visitor

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

1 ACCEPTED SOLUTION
sanimesa
Post Prodigy
Post Prodigy

@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])
 
pbi forum - lookupvalue.PNG

View solution in original post

2 REPLIES 2
sanimesa
Post Prodigy
Post Prodigy

@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])
 
pbi forum - lookupvalue.PNG

Thanks a ton :). Problem resolved.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.