Forum Discussion
Sales - stock Calculation
- 8 years ago
Hi Iamnvt, can you upload the sample file elsewhere? I can't download it from the current host.
it is Onedrive link. My friend can download it well. Could you please try again? DAX0110
- DAX01108 years agoResolver V
- Iamnvt8 years agoContinued Contributor
hi,
thanks for the answer. However, it doesn't give the correct result yet.
Order Date Product Requirement
1 11/25/2017 A 9 2 11/26/2017 B 18 3 11/27/2017 A 5 I understand your approach of running total, and able to modify the DAX to give the correct result.
Questions regarding to the DAX:
1. What is the purpose of calling the variants with firstnonblank?
2. when I remove the date field out of the pivot. it seems not working. How can I fix that?
ProductPBI Total Sold Qty PBI Running Sold Qty PBI Stock Qty PBI Material Requirement
A 15 0 1 B 20 0 2 - DAX01108 years agoResolver V
Hi Iamnvt,
Good to see that you can debug my DAX formula - it's always harder to troubleshoot someone else's work than starting over from scratch yourself, so good work!
As for FIRSTNONBLANK - you can also use SELECTEDVALUE if doing this in Power BI Desktop. It has to be used because there is only a filter context at that point. Try remove it and see what happens.
The pivot table after removing date? Well it's still working. This is my screenshot: