Forum Discussion

Hezekiah's avatar
Hezekiah
Frequent Visitor
7 years ago
Solved

Changing context

I have two tables, Person and Product Usage. The Person table has a Person ID field. Product Usage Table has two fields: Person ID and Product. Each record in the Product Usage table indicates which ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Hezekiah,

     

    When I test on your data, I found a simply way to achieve your requirement, please try to use below measure formulas:

    Count of All Purchased = 
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                ALLSELECTED ( 'Product Usage' ),
                [ID],
                "Count", COUNT ( 'Product Usage'[Product] )
            ),
            [Count] = COUNTROWS ( ALLSELECTED ( 'Product Usage'[Product] ) )
        )
    )
    
    All Purchased Customer list = 
    CONCATENATEX (
        FILTER (
            SUMMARIZE (
                ALLSELECTED ( 'Product Usage' ),
                [ID],
                "Count", COUNT ( 'Product Usage'[Product] )
            ),
            [Count] = COUNTROWS ( ALLSELECTED ( 'Product Usage'[Product] ) )
        ),
        [ID],
        ","
    )
    

     

    Regards,

    Xiaoxin Sheng