Analysis Services handles NULL and 0 as the same thing, and 0 would normally be considered something worth counting, whereas NULL wouldn’t.
When you count for example the sex of distinct customer, you dont’ want to count who not have sex, (the null value). you have to do these:
- Create a new column on the fact table that indicates whether the field we want to distinctcount is null. To do this we add a new column and give it the fixed value 1 when the Attribute is empty.
- Create three measures
- DistinctOriginal: Standard measure, DistinctCount on attribute, hidden measure
- IsAttributeNumberNull:Standard measure, MAX on isAttibuteNull, hidden measure
- DistinctAttribute: Calculated measure, Formula: DistinctOriginal – IsAttributeNumberNull
And that’s it, use the new calculated measure for a distinct count that does not count NULLs.