Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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 ...
  • Anonymous's avatar
    Anonymous
    7 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]))