Forum Discussion
Anonymous
7 years agoNot applicable
Stock in and out
Hi all, Another begginer question. I am working with products entering and leaving a facility, and I am trying to get the count of stock at any particular date. I have a stock dimension with ...
- Anonymous7 years ago
I've found the solution, I leave the code I used for future reference:
Count A = CALCULATE(COUNTROWS('in and out'), FILTER('in and out','in and out'[Category]="A"),filter(ALL('in and out'),'in and out'[Date In] <= 'Calendar'[Date])) - CALCULATE(COUNTROWS('in and out'), FILTER('in and out','in and out'[Category]="A"),filter(all('in and out'),'in and out'[Date out] <= 'Calendar'[Date])) + CALCULATE(COUNTROWS('in and out'),FILTER('in and out','in and out'[Category]="A"), FILTER('in and out','in and out'[Active]))
v-chuncz-msft
Community Support
7 years agoAnonymous ,
You may refer to the following posts.
Anonymous
7 years agoNot applicable
Thanks for your reply. Unfortunately that doesn't seem to work for me.
I am no expert in DAX, so maybe I am inputing the code incorrectly, however, even that measure would not provide me with the solution I need, which is a different count for each category, not just a total count.
Would really appreciate some help :)
- Anonymous7 years agoNot applicable
Any new ideas?
- Anonymous7 years agoNot applicable
I've found the solution, I leave the code I used for future reference:
Count A = CALCULATE(COUNTROWS('in and out'), FILTER('in and out','in and out'[Category]="A"),filter(ALL('in and out'),'in and out'[Date In] <= 'Calendar'[Date])) - CALCULATE(COUNTROWS('in and out'), FILTER('in and out','in and out'[Category]="A"),filter(all('in and out'),'in and out'[Date out] <= 'Calendar'[Date])) + CALCULATE(COUNTROWS('in and out'),FILTER('in and out','in and out'[Category]="A"), FILTER('in and out','in and out'[Active]))