Forum Discussion
Cumulative Distinct Count With Slicer Condition
Hi there. You can try this:
CumMeasure =
CALCULATE (
DISTINCTCOUNT( Table[ID]);
FILTER (
ALLSELECTED( Table );
Table[Created Date] <= MAX ( Table[Created Date] )
)
)
I think that should work. It might be more effective to involve your date table if you are using one. Adding DateTable in the ALL and using its DateColumns in the filter condition.
I hope that helps,
Hi there ibarrau, thank you very much for your response!
If I use what you have suggested in "Table", then every row has the same value which is the total distinct count of the whole table.
Yes, I do have a date table. If i place the following in the date table, it gives me the expected cumulative sum, but it is not affected by slicers on the location column.
CumMeasure = CALCULATE (
DISTINCTCOUNT ( Table[ID] ),
FILTER (
ALLSELECTED( Table ),
Table[Created Date] <= DateTable[Date]
)
)
How might I get a slicer on location to affect these results - or is that not possible since if the cumulative sum is in the date table, then it is in a different table to the location column.
Many thanks for your help!
- ibarrau5 years agoSuper User
Hi, that's weird. Anyway, if you use date table it has to be like this:
CumMeasure = CALCULATE (
DISTINCTCOUNT ( Table[ID] ),
FILTER (
ALLSELECTED( DateTable ),
DateTable[Date] <= DateTable[Date]
)
)That should work.
Regards