Forum Discussion

erhang's avatar
erhang
Helper II
8 years ago
Solved

Formula to Distribute Stocks

Hi there 

 

İ need your supports  pls .

İ hope you can help .Thanks in advance for your supports.

 

 

I have below two table . i have stocks and i want to distribute these  stocks based on some rules.

 

 

Rules : 

 

1-Stock qty will be distributed based on "requsted delivery date". Earliest day will have the first priority.

2-İf the "requested delivery date"  are same day for each line ( as i marked red on above table) , system will check document number and the smallest "document number"  will have the first priority.

3-İf the "requested delivery dates" are different , system will never care document numbers.

 

after this calculation rule , i want as below table  : 

 

 

i will be so grateful if you can help me dears .

 

Erhan 

1 Reply

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi erhang

    I test with your example and get this result.

    Here is my pbix for your reference.

     

    Best Regards

    Maggie