Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to calculate revised production order qty per product per day subtracting the available on hand quantity from first orders.
Here is the original order quantity table:
And here are currently available quantities:
From this, we can see that the first orders don't have to be produced since we can ship the products that we have on hand:
How to create this 'Revised Order Qty' measure?
The production order qty needs to be decreased as long as there is something on hand.
(in chronological order)
Solved! Go to Solution.
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
I think you want a calculated column in your Table1 rather than a measure. If so:
Revised Order Qty = VAR Cum_ = CALCULATE ( SUM ( Table1[Order Qty] ), ALLEXCEPT ( Table1, Table1[Product] ), Table1[Date] <= EARLIER ( Table1[Date] ) ) VAR OnHand_ = LOOKUPVALUE ( Table2[On Hand Qty], Table2[Product], Table1[Product] ) RETURN MAX ( Cum_ - OnHand_, 0 )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
I think you want a calculated column in your Table1 rather than a measure. If so:
Revised Order Qty = VAR Cum_ = CALCULATE ( SUM ( Table1[Order Qty] ), ALLEXCEPT ( Table1, Table1[Product] ), Table1[Date] <= EARLIER ( Table1[Date] ) ) VAR OnHand_ = LOOKUPVALUE ( Table2[On Hand Qty], Table2[Product], Table1[Product] ) RETURN MAX ( Cum_ - OnHand_, 0 )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
This is exactly what I needed - thank you !
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |