0

We have a cube that it has one measure (Commission Amount) and two dimensions customer and Date. I want calculate ratio of (count of customers who create 80 percent of Commission Amount) to (count of total customer) It is important to say that customers are sorted base on their Commission Amount How can solve this problem? And what must use to solve this query?

Pari
  • 31
  • 3

2 Answers2

0

You want to use the TopPercent() function here:

TopPercent(
    existing [Customer].[Customer].[Customer].Members, 
    80,  
    [Measures].[Commission Amount]  
)
/
existing [Customer].[Customer].[Customer].Members.Count
Danylo Korostil
  • 1,464
  • 2
  • 10
  • 19
0

Basically the same approach as Danylo - I just added an extra COUNT and deleted some, possibly redundant, EXISTING keywords:

DIVIDE(
  COUNT(
    TOPPERCENT(
      {[Customer].[Customer].[Customer].MEMBERS}, 
      80,  
      [Measures].[Commission Amount]  
    )
  )
  ,[Customer].[Customer].[Customer].MEMBERS.COUNT
)
whytheq
  • 34,466
  • 65
  • 172
  • 267