Forum Discussion
Complicated date matching help needed...
Thanks Liu for the solution. I tried to implement it and the issue I am running into is this: In reality I have many orders and many purchase orders for the various part Id's, and when I tried to use your formula and dug into the .pbix file, your example is built from a relationship of 1:1 between customer orders and parts on hand. In reality it needs to be a many to one relationship. What I've done so far is created a UNION table with QOH, customer orders and purchases orders with a running total for each part with QOH as the opening balance (I give a date to the opening balance of 01/01/2010 so it is always first) and then the customers orders are included as negatives and purchase order receipts as positives, each with their dates. Then I create a column with a running total by type. Any time a negative occurs it means a shortage (the most critical curcumstance this report needs to address- or pull-ins). I somehow need a way for each negative to be matched up with the next Purchase Order for that part and have the new date required matched somehow with that PO so we can send it to the supplier.
Having said all that, I appreciate your solution. It is very impressive. It seems however to only handle a situation where there is a 1:1 between orders and parts.