Get distinct count on calculated member? I'm using SSAS and created a measure group that is linked to Fact_SalesMetrics on SQL Server. In that, I have seven measures. All measures have aggregation of Sum except Sales Invoice which has aggregation of Distinct Count.

Everything works great. I need to make the aggregation of 'CustomerID' also to Distinct count, but I can't be able to. It says me error states, "The measure group has more than one distinct count measure."

So, I need to have these two measures's aggregation as DistintCount. How can I? Any help will be appreciated.

I thought to create a calculated member to achieve this but got failed as I don't know what expression I have to give!
The limitation of a single distinct count per measure group is related to performance. To get both distinct count measures to show up in the same measure group, you can use the workaround suggested here by Darren Gosbell.

best of both worlds...performance benefit from each DC-measure residing in its own measure group, UX benefit from having all related measures appearing in same measure group.