This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi
I am having problem with solving this scenario. I have multiple transaction of specific model per day . I want to allocate this sales quantity to import purchase quantity which will also have specific model with multiple day. My criteria is using date , product model and import declaration number. The following is an example of data and the result i want to get ;
Sales Table
| Sales Date | Product Name | Quantity |
| 3/1/2022 | A | 30 |
| 5/1/2022 | B | 20 |
Purchase Table
| Purchase Date | Import Declaration Number | Product Name | Quantity | Cost | Exchange Rate |
| 2/12/2022 | 100161238551 | A | 20 | 200 | 1.5 |
| 2/19/2022 | 100161238554 | A | 20 | 200 | 1.7 |
| 2/22/2022 | 100161238557 | A | 20 | 200 | 1.3 |
| 3/12/2022 | 100161238580 | B | 20 | 500 | 1.8 |
The Result i want to get
| Purchase Date | Import Declaration Number | Product Model | Quantity | Cost | Exchange Rate | Sold | Closing Inventory |
| 2/12/2022 | 100161238551 | A | 20 | 200 | 1.5 | 20 | - |
| 2/19/2022 | 100161238554 | A | 20 | 200 | 1.7 | 10 | 10 |
| 2/22/2022 | 100161238557 | A | 20 | 200 | 1.3 | - | 20 |
| 3/12/2022 | 100161238580 | B | 20 | 500 | 1.8 | 20 | - |
Can someone help me? Also thanks in advance.
Hey @PhyuLayKhine333 ,
please explain the rule that leads to the expected result.
Regards,
Tom
My rule is like first in first out method using purchase date's declaration import number, purchase date criteria. Product A from purchase table which have different multiple import declaration number link with product A from sales table quantity and date criteria . The final i want to get is cost of sales and closing inventory of fifo method .
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 33 | |
| 25 | |
| 23 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 41 | |
| 27 | |
| 22 | |
| 22 |