Is there a way to get YTD Distinct Counts to scale?
Assume a model with customers (~ 1 million) and sales (~ 1 billion) related by a customer id.
Lots of demographics hang off the customer.
To add calculations to the model for Customer with Sales and YTD Customer with Sales is simple enough..
Customer with Sales:=DISTINCTCOUNT('Sales'[Customer Id])
YTD Customer with Sales:=TotalYTD(DISTINCTCOUNT('Sales'[Customer Id]),'Period'[THIS_DATE] ,"30-06")
That works , problem is it doesn't scale. It's slow, particularly if months is in the rows and the measures include the YTD value.
Is there a faster way of doing this?
I tried DISTINCTCOUNT(Customer[Customer Id]) but this includes customers without sales.