I'm trying to create a calculated column in powerpivot to count the distinct orders per customer. The table (Sales) contains product information so has multiple rows per order and multiple orders per customer.
I want this to be a calculated column as I will use the results to build a frequency/histogram table.
I have been trying the following formula but it is very slow and it not bringing any results back.
=CALCUALTE(DISTINCTCOUNT(Sales[OrderNumber]),FILTER(Sales,Sales[Email]=EARLIER(Sales[Email])))
Does anyone have another idea how I could structure the formula to be faster? The table contains 13 million records.
Thanks
Mike