Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 table looks like this:
Column CummulativeCount should show the sum of [CountThisYearPerWeek]-values for weeks from 1 until [Weeknumber]. In the example I would expect the values 110 - 257 - 434 - 599 - 757 etc.
I am using the following code:
Solved! Go to Solution.
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] )
)
)
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] )
)
)
Thank you, Alexis. You made my day!
@AlbertJan , Try
CummulativeCount = CALCULATE(
SUM( SalesInfoPivot[CountThisYearPerWeek] ),
FILTER(allselected(SalesInfoPivot),
SalesInfoPivot[WeekNumber] <= [WeekNumber]))
or
CummulativeCount = CALCULATE(
SUM( SalesInfoPivot[CountThisYearPerWeek] ),
FILTER(all(SalesInfoPivot),
SalesInfoPivot[WeekNumber] <= [WeekNumber]))
Thanks for yor reply. Unfortunately this does not solve the problems. Rows are not filtered.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |