
One of the propeties of a DistinctCount in SSAS, is that the DistinctCount also calculates a NULL value. So if you have the value 10,10,20,20, NULL in a Cube the DistinctCount value will be 3, the count will be 5. In a lot of cases you don’t want the null value to be part of the set that the DistinctCount aggregate uses to calculate.
How to solve this. Well the answer is actually very simple. The DistinctCount needs an own partition, this is the key to solve this problem. You can easily change the query that is executed to get the data for the partition. Just add a simple clause like “Col1 IS not NULL”, and you don’t have to write you’re own DistinctCount in MDX or create separate table is de DSV.