Forum Discussion
AlbertJan
4 years agoFrequent Visitor
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...
- 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] ) ) )
AlexisOlson
Super User
4 years agoTry 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] )
)
)- AlbertJan4 years agoFrequent Visitor
Thank you, Alexis. You made my day!