Forum Discussion

SACooper's avatar
SACooper
Helper II
2 years ago
Solved

Week on Week Stock Comparrison problems.

I am looking to produce a week-on-week comparison of stock levels. We ideally take stock on the same day each week, but occasionally this gets pushed back a day or two and we just accept the variatio...
  • SACooper's avatar
    2 years ago

    Eureaka!

    solved it!

     

    //Orignal code to this point
    
    VAR lastweekstock =
        CALCULATE(
            SUM('Stock'[instock]),
            'Stock'[Date created] >= lastweek.
            'Stock'[Date created] < lastweek + 7,
            ALLEXCEPT('Stock', 'Stock'[StockItem])
        )
    
    //Original code from this point