Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Tabular YTD Distinct Counts

$
0
0

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.


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>