Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I am trying to create a table that shows the available to promise inventory. In other words, the unallocated inventory for a given week.
I have 4 key data inputs
The issue I have is that I need to use the previous "available to promise" value as my opening inventory for the following week. I cannot share the sensitive data but an example of what I am trying to achieve is below:
| Item XYZ 1 | Week Number | (notes) | On Hand | Demand | On Order | Available to Promise (ATP) |
| 1 | This is my opening inventory > | 100 | 10 | 0 | 90 | |
| 2 | This is previous week ATP> | 90 | 40 | 10 | 60 |
The second issue is that when I generate the new on-hand sheet I need to exclude all prior dates as these will no longer be valid against the new inventory position.
This is something I could do in a few seconds in excel but my power bi knowledge is very much on a steep learning curve.
I have searched extensively but I can't quite get my head around how to solve this problem. Any support would be very welcome.
Thanks.
Solved! Go to Solution.
You are a superstar! This worked exactly how I needed it to. I see now my attempts all failed as I hadn't set the boundary for end of the week.
Thank you
You are a superstar! This worked exactly how I needed it to. I see now my attempts all failed as I hadn't set the boundary for end of the week.
Thank you
HI @GM19 ,
Try these measures.
On Hand = SUM('Current Inventory Position'[Quantity])On Order = VAR __Today =
TODAY ()
VAR __WeekStartDate =
__Today - WEEKDAY ( __Today, 1 ) + 1
VAR __WeekEndDate = __WeekStartDate + 6
RETURN
CALCULATE (
SUM ( 'Receipts'[Quantity] ),
ALLEXCEPT ( 'Current Inventory Position', 'Current Inventory Position'[Item Code] ),
__WeekStartDate <= 'Receipts'[Planned Delivery Date],
__WeekEndDate >= 'Receipts'[Planned Delivery Date]
)Demand =
VAR __Today =
TODAY ()
VAR __WeekStartDate =
__Today - WEEKDAY ( __Today, 1 ) + 1
VAR __WeekEndDate = __WeekStartDate + 6
RETURN
CALCULATE (
SUM ( 'Planned Customer Orders'[Quantity] ),
ALLEXCEPT ( 'Current Inventory Position', 'Current Inventory Position'[Item Code] ),
__WeekStartDate <= 'Planned Customer Orders'[Planned Ship Date],
__WeekEndDate >= 'Planned Customer Orders'[Planned Ship Date]
)Available to Promise (ATP) = [On Hand]-[Demand]+[On Order]
The result should be like this.
Also, attached the pbix file as the reference.
Best Regards,
Community Support Team_Gao
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @Anonymous I marked this as accepted but actually upon further viewing it doesn't quite solve the problem.
I need to see the ATP by week when I add the date back in this is where my issue is:
I created the relationship between the date fields which I think is what causes the issue since the opening inventory value has no date field.
Day 11 I was able to promise 100 but the following day I am only able to promise 80 despite knowing that I have 100 available. The on hand for day 12 needed to be the ATP from day 11.
I almost need to say IF the week number is this week then On hand = the sum of on hand ELSE it is the previous weeks ATP.
Thanks,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |