Forum Discussion

PGDEV's avatar
PGDEV
Regular Visitor
7 years ago
Solved

Cumulative value between two dates

Hello guys,   Someone can help me please ?   I want to cumulate NB of the last X months (in this example, I used 12 months). Cumul = CALCULATE(SUM('12MoisGlissant'[NB]);DATESBETWEEN('12MoisGliss...
  • PGDEV's avatar
    PGDEV
    7 years ago

    I find a solution :

    Cumul = 
    VAR MValue = '12MoisGlissant'[M]
    VAR M12Value =  '12MoisGlissant'[M-12]
    RETURN
    calculate(SUM('12MoisGlissant'[NB]);filter('12MoisGlissant';and('12MoisGlissant'[Début de mois]<=MValue;'12MoisGlissant'[Début de mois]>=M12Value)))