locked
Distinct Count Customer With Filter RRS feed

  • Question

  • Hello Everybody.

    I need to add a calculated member to distinct count all customers, its all ok for me, but now i need to filter only that customers who has bought more than 5 units of any products (i got a measure for that called Units Sold)

     

    How can i solve that considering that i got many others dimensions and this measure should be visible with any combination of that???

     

    Thanks

    Tuesday, November 30, 2010 3:41 PM

Answers

  • Here's a sample query for Adventure Works, counting the customers whose [Internet Order Quantity] > 5:

    With
    Member [Measures].[CustomersBuying5Units] as
    Count(Filter(existing [Customer].[Customer].[Customer],
    [Measures].[Internet Order Quantity] > 5))
    select
    {[Measures].[Customer Count],
    [Measures].[CustomersBuying5Units]} on 0,
    [Product].[Category].Members on 1
    from [Adventure Works]
    -----------------------------------------
     Customer Count CustomersBuying5Units
    All Products 18,484 1657
    Accessories 15,114 523
    Bikes 9,132 9
    Clothing 6,852 31
    Components (null) 0


    - Deepak
    • Proposed as answer by Jerry Nee Thursday, December 2, 2010 8:51 AM
    • Marked as answer by Jerry Nee Sunday, December 5, 2010 2:02 AM
    Tuesday, November 30, 2010 4:55 PM