Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
Im struggling to create DAX measure for a forecasted closing stock position using the start point of the latest stock position, deducting forecasted sales, adding existing open purchase orders and adding forecasted purchase orders to create a forward stock position for each week going forward.
The below Excel example should help to explain:
Solved! Go to Solution.
Worked it out using existing response:
https://community.fabric.microsoft.com/t5/Desktop/closing-stock-calculation/m-p/2607672
Hello!
Adding here some metrics to calculate last stock position value that might be helpful. The [Last Constant Stock] metric can be used in the metric that will do the additions and subtractions with the other forecast metrics.
Sum of Stock Qty = SUM(Table[Stock Qty])
This blog explains the use of the DAX LASTNONBLANK command very well:
DAX LASTDATE vs. LASTNONBLANK | Mitchellsql (mitchellpearson.com)
Worked it out using existing response:
https://community.fabric.microsoft.com/t5/Desktop/closing-stock-calculation/m-p/2607672
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 10 |