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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors