Forum Discussion
Append Query 2 tables with similar data
I'm attempting to append/merge two tables to one. Reason is one table has Purchase Order Number, Line Number and Due Date but does not have Receipt Rate. Other table has Purchase Order, Line Number and Receipt Date.
Plan is to create measure for 'days late, or early' so that i can show on time delivery of my suppliers. The common thread between these two tables is the PO number and line number but they have to match.
When i try to append, it merges the data as one table - full load, then the other table has headers with a lot of null values where i expected to see them align on the PO number and line number. How can i get these 2 tables to play nice?
Please concat po number and line item, then do a lookup to bring the receipt date to purchase table, or you can merge the tables in PQ as well.
Let me know if this works.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!
Follow me on LinkedIn
7 Replies
- NaveenGandhi
Memorable Member
Hi Gr8apmech
Please share sample data and screenshot to understand the problem better.
Regards,
NG - Ashish_Mathur
Super User
Hi,
If you want to solve it using a calculated column in DAX, then you can use the LOOKUPVALUE() function. To receive more help, share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
- Gr8apmech
Helper I
Looking for help to make these 2 tables result in the expected result below. Do i merge the tables together or do i use DAX to pull the data from each table to a new table to create the "Days Early or Late" measure? What's the best way to make this work?Thanks!Purchase Orders table:PO NumberLine Item NumberDue DateABC12317/25/2024ABC12327/30/2024ABC12338/15/2024Receipts Table:PO NumberLine Item NumberPart NumberReceipt DateABC1231JAC17/24/2024ABC1232JAC237/31/2023ABC1233JAC42Expected Result:PO NumberLine Item NumberPart NumberDue DateReceipt DateDays Early or LateABC1231JAC17/25/20247/24/2024-1ABC1232JAC237/30/20237/31/20231ABC1233JAC428/15/2023337- NaveenGandhi
Memorable Member
Please concat po number and line item, then do a lookup to bring the receipt date to purchase table, or you can merge the tables in PQ as well.
Let me know if this works.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!
Follow me on LinkedIn- Gr8apmech
Helper I
Thanks, the concatenate worked great. I have not thought of that. I will research how to do a lookup between the 2 tables which now have PO & Line # concatenated as ABC123,1.
- Ashish_Mathur
Super User
Hi,
Write these calculated column formulas in the Receipts table
Due date = LOOKUPVALUE('Purchase orders'[Due Date],'Purchase orders'[PO Number],Receipts[PO Number],'Purchase orders'[Line Item Number],Receipts[Line Item Number])Column = 1*(Receipts[Receipt Date]-Receipts[Due date])Hope this helps.
- Gr8apmech
Helper I
Hi NaveenGandhi and Ashish_Mathur . Any help on the above is much appreciated!