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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
erhang
Helper II
Helper II

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.

Capture24.JPG

 

 

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  : Capture25.JPG

 

 

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

 

Erhan 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @erhang

I test with your example and get this result.

3.png

Here is my pbix for your reference.

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @erhang

I test with your example and get this result.

3.png

Here is my pbix for your reference.

 

Best Regards

Maggie

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.