Forum Discussion
Closing Stock Calculation
- 8 years ago
Thanks again for taking the time to help me out.
I have updated my file to get the closing stock after taking into consideration the last date for every month, all thanks to your help. I have created a new measure 'On Hand Quantity' in the 'Final Table'.
Here is the link:
https://1drv.ms/f/s!Ap0qSKP-4qpThCGX0VuaSk-I9cxx
Now I am trying to get the prices in my closing stock table, so that all my closing stock can be bifurcated.
I would really like to know from where have you learned how to code DAX cause you are so quick with your solutions and they work!
I have been spending hours an hours and not getting any results. If you could please tell me if there is any book that I can use to learn how to code in DAX.
Again a huge thanks for all your help.
Vishesh Jain
- 8 years ago
Then add this MEASURE in this new Table
Closing_Stock =
CALCULATE (
SUM ( CombinedTable[Quantity] ),
FILTER (
ALLEXCEPT ( CombinedTable, CombinedTable[Size], CombinedTable[Type] ),
CombinedTable[Date] <= SELECTEDVALUE ( CombinedTable[Date] )
)
)Another thing I am seeing in my table is that, if I take the Size and Type from their seperate respective tables, the measure starts giving wrong results.
It is just adding the Closing Stock up for that Date and showing it in every single row, regardless or Type and Size.
Again this will be a problem when I use the Type and Size in the slicer.
I have created relationships between the new Combined Table and the Type and Size tables, but the values itself are wrong.
It would be great if you can help me fix this.
Thank you,
Vishesh Jain