Skip to main content
Skip table of contents

Count

Returns the number of tuples in a set.

Empty cells are included unless ExcludeEmpty optional flag is used.

Syntax

CODE
 Count( Set_Expression [ , ( ExcludeEmpty | IncludeEmpty ) ] )
OR
 Set_Expression.Count

Arguments

Set_Expression

MDX expression that returns set.

ExcludeEmpty

Empty cells are included unless this optional flag is used.

Examples

Following example counts for how many new customers are added at the current date.

CODE
NonZero(Count(
  Filter(
    NonEmptyCrossJoin(
      Descendants(
        [Customer].CurrentMember,
        [Customer].[Customer]
       ),
      [Measures].[Invoice amount]),
      [Measures].[Invoice amount] > 0 AND
      [Measures].[Invoice amount] = (Sum(PreviousPeriods([Time].CurrentHierarchyMember), [Measures].[Invoice amount])) +[Measures].[Invoice amount]
   )
  )
)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.