Search code examples
mdx

How do I create a calculated measure that is simply a count of members from a dimension


How can I display the count of records (accounts) from a dimension in a calculated measure. For example, the following expression is the MDX to list all Accounts.

     [Customer Credit].[Account Name].[Account Name].members

Is it possible to create a Measure, that will have the COUNT of all Accounts?


Solution

  • Using the MDX count function:

    with member [Measures].[My Count] as 
          [Customer Credit].[Account Name].[Account Name].members.count
    select [Measures].[My Count] on 0
    from [your-cube]