The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a measure called 'End Avail Inv (W)' that should either return our actual ending inventory for each historical week, or project the ending inventory for future weeks based on Prior Week Ending Inventory - Demand + Supply. This measure works for history and through the first future week, but then only returns the difference between our demand and supply after that.
I need the value to be carried forward week over week.
The 'Beg Avail Inv (W)' measure should be equal to the previous weeks 'End Avail Inv (W)' value, but in the second future week, it is also returning just the difference between demand and supply.
The greyed out columns are just for reference and are not part of the End Avail Inv calculation
@Beezer70 This smells a bit like recursion which DAX hates. However in some cases you can get around it. If you can post sample data that would speed things along.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
This is definately a recursion issue. It is easy to produce the result I want in Excel
The final output should look like this:
All the values in the visualization are measures coming from different sources, but matched on key fields
[End Avail Inv (W)] = [Beg Avail Inv(W)] - [Demand (True) (W)] + [Supply]
[Beg Avail Inv (W)] = [End Avail Inv (W)] of the previous week
[Demand (True) (W)] = the greater of [Customer Orders received by Request Date] and [Forecasted Demand]
[Supply] = [Planned Production for the week] + [Goods Purchased- being received in the week]
Sample Data:
FW End Dt | Wk Act/Fcst | Beg Avail Inv (W) | Demand (True) (W) | Supply | End Avail Inv (W) |
6/29/2024 | Act | 48,124,924 | 3,629,903 | 1,116,043 | 45,832,998 |
7/6/2024 | Act | 45,832,998 | 3,058,383 | 1,173,134 | 44,805,817 |
7/13/2024 | CW | 44,805,817 | 3,189,715 | 2,562,888 | 44,773,892 |
7/20/2024 | Fcst | 44,773,892 | 2,989,246 | 5,806,530 | 47,591,177 |
7/27/2024 | Fcst | 47,591,177 | 2,989,566 | 2,053,462 | 46,655,073 |
8/3/2024 | Fcst | 46,655,073 | 2,989,510 | 2,760,012 | 46,425,575 |
8/10/2024 | Fcst | 46,425,575 | 2,975,109 | 2,359,286 | 45,809,752 |
8/17/2024 | Fcst | 45,809,752 | 2,974,497 | 2,646,340 | 45,481,595 |
8/24/2024 | Fcst | 45,481,595 | 2,974,092 | 2,281,750 | 44,789,253 |
8/31/2024 | Fcst | 44,789,253 | 2,973,774 | 3,107,209 | 44,922,688 |