Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Return first date with zero inventory

Hi all, 

 

I need to find the first date our sales location have zero inventory of a product. 

 

I have tried every possible way to calculate this. 

 

So wanted result is this: 

 

I nedd to get the date when inventory reaches 0. 

How do I create a measure or calculated column that gives me the running inventory for every date? Or is this achievable with a measure? 

Which formula do I use to get the date? I have tried 

 

first date below 0 = MINX(FILTER(Table, [Measure running inventory] <= 0),Table[Date])
 
But this returns the first date of activation
 
Please help! 🙂

5 Replies

  • =calculate(min(table[date]),filter(all(table),table[runninginventory]<=0))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, but I don't have the runninginventory as a column. I dont understand how to calculate it. If i solve that everything else should fall in place. 

       

      Any suggestions? 

      • rfigtree's avatar
        rfigtree
        Resolver III

        running=calculate(sum([distributed]) - sum([activated]) - sum([returned]), filter(all(table), [date] <= earlier([date]))