Forum Discussion

rodrigoestrella's avatar
rodrigoestrella
Frequent Visitor
6 years ago
Solved

sum quantities over different time periods

Hello !  I have to calculate stock adjustments over sales in several stores of a supermarket in the period between the last stock count and today. The thing is that the stock count date is different...
  • DataInsights's avatar
    6 years ago

    rodrigoestrella, try this measure:

     

    Adjustments = 
    SUMX (
        Merms,
        IF ( Merms[adjustment_date] >= RELATED ( DimStore[stock_date] ), Merms[amount] )
    )

     

    Data model:

     

     

    By store_id:

     

     

    By location: