Forum Discussion

robbinkees1's avatar
robbinkees1
Frequent Visitor
4 years ago
Solved

Stock simulation over time

Hi all,    I'am working on a report which tells me in which week I'm running out of stock.    Stock incoming column: Purchase order quantity's that will be delivered in that week.  Sales column:...
  • v-zhangti's avatar
    v-zhangti
    4 years ago

    Hi, robbinkees1 

     

    You can try the following methods.

    Measure:

    Stock over time = 
    SUM ( 'Table'[Current_Stock] )
        + CALCULATE (
            SUM ( 'Table'[in/out] ),
            FILTER ( ALL ( 'Table' ), [Date] <= SELECTEDVALUE ( 'Table'[Date] ) )
        )

     

    Column = 
    [Current_Stock]
        + CALCULATE (
            SUM ( 'Table'[in/out] ),
            FILTER ('Table' , [Date] <= EARLIER( 'Table'[Date] ) )
        )

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.