I have a calculated column which returns the rank of each row by date. Essentially, this column is ranking or "counting" the number of purchases a customer makes (because each time they make a new purchase, a new row is added and that row has a higher rank than their previous purchase.
Purchase Count = RANKX(FILTER(Purchases,Purchases[ID]=EARLIER(Purchases[ID])), Purchases[Date], ,asc)
Result
Note that Alison has 3 purchases and the Purchase Count column counts if it's her 1st, 2nd, or 3rd purchase by Date
What I want is a measure which will essentially count the number of maximum values per customer (which would mean 1, because there is only 1 maximum per customer), but the COUNT function will not accept the MAX function as an input. i.e. COUNT(MAXA(Purchase Count)
What I am trying to develop is something like this:
But the best I can do is this: which is just a simple count of the Purchase Count calculated column (seen above). I want the bar chart to match the "Dynamic Purchases (measure)" column below. In other words, I want the 3 on the x-axis to have a value of 1, because there is only 1 person who has made 3 purchases. I wan the 2 on the x axis to have a value of 0, because there are no customers that have made 2 purchases, and I want the 1 on the x-axis to have a value of 1, because "Billy" is the only customer that has made only 1 purchase. With a simple count, it adds 1 to each column for Alison, because she has made a 1st, 2nd, and 3rd purchase. I ONLY WANT TO COUNT HER MAXIMUM PURCHASE. I WANT TO IGNORE HER 1ST and 2ND PURCHASES