Forum Discussion

AlbertJan's avatar
AlbertJan
Frequent Visitor
4 years ago
Solved

Cummulative sales figures

Hello,   I am building a sales dashboard using a table SalesInfoPivot with summarized salesfigures per week. I want to add an extra column with cummulative salesfigures for each week. Part of the t...
  • AlexisOlson's avatar
    4 years ago

    Try adding EARLIER in so that it knows you're referring to the earlier (original) row context rather than the row context from FILTER.

     

    CummulativeCount =
    CALCULATE (
        SUM ( SalesInfoPivot[CountThisYearPerWeek] ),
        FILTER (
            SalesInfoPivot,
            SalesInfoPivot[WeekNumber] <= EARLIER ( SalesInfoPivot[WeekNumber] )
        )
    )