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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tuan
Helper III
Helper III

Merging Two Data Tables (Invoice and Orders)

I'm trying to merge invoice and orders together with the exclusions of orders that already been invoiced.

 

I have my Invoice Data as

InvoiceCustomerValue
1000ABC100
1001Bee200
1002Cali300
1003Burrito

400

And my order data as 

 

InvoiceOrderCustomerValue
1000201ABC100
1001202Bee200
1002203Cali300
1003204Burrito400
 205ABC100
 206ABC200

 

 

I want the end data to look like 

 

Transaction TypeInv/OrderCustomerValue
Invoice1000ABC100
Invoice1001Bee200
Invoice1002Cali300
Invoice1003Burrito400
Order205ABC100
Order206ABC200

 

Is there a guide that shows how I can do this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

If the order is invoiced you have invoice number, else you have just order number alone & invoice number is blank. So allrequied details are available in order table itself.

 

Create the below 2 columns and drag along with customer and value columns from the Order table. 

 

Invoice/order = IF( ISBLANK( Order[InvoiceNo]), Order[OrderNo],Order[InvoiceNo])

 

TransactionType= IF( ISBLANK( Order[InvoiceNo]), "Order","Invoice")

 

Hope this helps.

 

Thanks

Raj

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

If the order is invoiced you have invoice number, else you have just order number alone & invoice number is blank. So allrequied details are available in order table itself.

 

Create the below 2 columns and drag along with customer and value columns from the Order table. 

 

Invoice/order = IF( ISBLANK( Order[InvoiceNo]), Order[OrderNo],Order[InvoiceNo])

 

TransactionType= IF( ISBLANK( Order[InvoiceNo]), "Order","Invoice")

 

Hope this helps.

 

Thanks

Raj

There is much more data then those listed columns. Just made it smaller as an example.

Anonymous
Not applicable

Still this will work. Did you try the above approach?

Not yet, will try it! 

 

Thank you so much for the help!

I actually wanted to append the tables together. But your formula help me think it through. I probably didn't do it in the best way. I essentially did a lookup if the invoice exist and filtered out the orders and then i renamed the columns to match together and append them.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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