Reputation: 958
Here is what I would like the output to be; a line graph showing cumulative counts according to year [ignore the dashed line, not relevant here]:
I created a cumulative measure like this:
Cumulative count =
if(COUNTROWS(database)>0,
CALCULATE (
COUNTA ( database[case] ),
FILTER (
ALLSELECTED( database),
database[Weeks2Create] <= MAX ( database[Weeks2Create] )
)
)
)
Displaying single years work well (both ending around he 5k mark):
However, when I select multiple years... the counts seem to be adding up [see endpoint in graph below at ~10k, instead of 5k]:
What have I done wrong?
Upvotes: 0
Views: 423
Reputation: 3741
Try to add to your calculation && database[Year] = SELECTEDVALUE(database[Year]) to specify that we want to calculate each line independently.
Upvotes: 1