MDX: Count number of dimension members

If you are trying to count the number of dimension members via MDX, where your measure is [Measure].[Item Quantity] and dimension is [Item].members, you can write your MDX query as:
with
member [Measures].[blah] as ‘Count(Crossjoin({[Item].members}, {[Measures].[Item Quantity]}), EXCLUDEEMPTY)’
select {
  [Measures].[Item Quantity], [Measures].blah
} on columns, {
  [Item].children
} on rows
from [Cube]
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s