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.
Hello,
I am trying to write a formula that calculates remaining inventory based off a ship date and I am about to rage quit because I cannot figure it out! This is my current formula and its not working the way I need it to:
Remaining Inv = 'Working Page'[On Hand]
-MAXX(TOPN(1,FILTER('Working Page','Working Page'[ID]=EARLIER('Working Page'[ID])&&'Working Page'[Ship Date]<EARLIER('Working Page'[Ship Date])),'Working Page'[Ship Date]),'Working Page'[Order Qty])
I need a column that takes the On hand inventory and subtracts the qty ordered based off date. However, the issue is its taking the total On hand rather than the difference from the previous ship date. The results I am looking for are in the Remaining Inv.
| ID | On Hand | Item Name | Description | Order Qty | Location | Ship To | Index | Ship Date | Remaining Inv |
| Item1Location1 | 23139 | Item1 | RB | 100 | Location1 | Customer 1 | 1 | 7/2/2024 | 23039 |
| Item1Location1 | 23139 | Item1 | RB | 100 | Location1 | Customer 2 | 2 | 7/3/2024 | 22939 |
| Item1Location1 | 23139 | Item1 | RB | 100 | Location1 | Customer 3 | 3 | 7/3/2024 | 22839 |
| Item1Location1 | 23139 | Item1 | RB | 200 | Location1 | Customer 4 | 4 | 7/3/2024 | 22639 |
| Item1Location1 | 23139 | Item1 | RB | 100 | Location1 | Customer 5 | 5 | 7/5/2024 | 22539 |
| Item1Location1 | 23139 | Item1 | RB | 300 | Location1 | Customer 6 | 6 | 7/5/2024 | 22239 |
| Item1Location1 | 23139 | Item1 | RB | 200 | Location1 | Customer 7 | 7 | 7/23/2024 | 22039 |
| Item1Location1 | 23139 | Item1 | RB | 1300 | Location1 | Customer 8 | 8 | 7/24/2024 | 20739 |
| Item1Location1 | 23139 | Item1 | RB | 2100 | Location1 | Customer 9 | 9 | 7/24/2024 | 18639 |
| Item1Location1 | 23139 | Item1 | RB | 800 | Location1 | Customer 10 | 10 | 7/24/2024 | 17839 |
| Item1Location1 | 23139 | Item1 | RB | 1400 | Location1 | Customer 11 | 11 | 7/24/2024 | 16439 |
| Item1Location1 | 23139 | Item1 | RB | 2100 | Location1 | Customer 12 | 12 | 7/24/2024 | 14339 |
Solved! Go to Solution.
Hello @MrJayDee
please check if this accomodate your need.
Hello @MrJayDee
please check if this accomodate your need.
Check out the May 2026 Power BI update to learn about new features.
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 |
|---|---|
| 29 | |
| 27 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 22 | |
| 19 | |
| 18 |