I have a simple list of OpportunityIDs in a PowerPivot data model like this:
OPPORTUNITY_ID
1
2
3
3
3
4
4
5
And I want to add a DAX expression in a CalculatedColumn that counts the occurrence of each OpportunityID, like this:
OPPORTUNITY_ID COUNT
1 1
2 1
3 1
3 2
3 3
4 1
4 2
5 1
So, where there are multiple occurrences of the OpportunityID, the count would show cumulatively e.g. 1,2,3 etc.
I tried many ways of doing this but can't get anything to work. I think that answer may lie in the RANKX expression, but I don't understand how to get it working.
Any help will be greatly appreciated!
CALCULATE
,FILTER
andEARLIER
(this last one allows you to compare to other rows). See this as an example: sqlblog.com/blogs/alberto_ferrari/archive/2011/03/08/… – Andi Mohr