cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Intersections of customer product purchases

Hi

 

I need help with producing a count of the intersections bewteen customers and which items they have purchased. For example, if there are 5 products, a customer can purchase any single product or any combination of the 5. Customers can also re-purchase a product at any date - this is where my problem arises as an end user wants to be able to see the intersections for any selected date range.

 

I have managed to come up with a solution which includes the use of parameters but this is not ideal as the end user does not have access to change any parameters of the report.

 

I'm open to any solution that does not involve parameters, ideally a slicer with dates would be the best solution

 

The fields I have on the table are customer_ID, date_ID and product

 

Example Data

Data.PNG

 

Possible output with different slicer selections

 

Output.PNG

 

This is my first post so please don't hesitate to ask if I need to provide any more information that would help with a solution

 

Any help at all would be greatly appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Intersections of customer product purchases

Hi,

 

AFAIK, current power bi not support to use slicer/filter to create dynamic calculated column/table. (Measure is possible to achieve this, but it not support to use as category)

 

So I think it is impossible to dynamic generate output table based on selection.

 

Sample measures:

Product List =
CALCULATE (
    CONCATENATEX ( VALUES ( Table1[product] ), [product], "," ),
    VALUES ( Table1[customer_id] )
)


Product/Custom Detail = 
VAR temp =
    SUMMARIZE (
        ALLSELECTED ( Table1 ),
        [customer_id],
        "Product Combo", CONCATENATEX ( VALUES ( Table1[product] ), [product], "," )
    )
VAR t2 =
    SUMMARIZE (
        temp,
        [Product Combo],
        "Customer list", CONCATENATEX (
            FILTER ( temp, [Product Combo] = EARLIER ( [Product Combo] ) ),
            [customer_id],
            ","
        )
    )
RETURN
    CONCATENATEX ( t2, [Product Combo] & ":" & [Customer list], "|" )

8.PNG

9.PNG

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Intersections of customer product purchases

Hi,

 

AFAIK, current power bi not support to use slicer/filter to create dynamic calculated column/table. (Measure is possible to achieve this, but it not support to use as category)

 

So I think it is impossible to dynamic generate output table based on selection.

 

Sample measures:

Product List =
CALCULATE (
    CONCATENATEX ( VALUES ( Table1[product] ), [product], "," ),
    VALUES ( Table1[customer_id] )
)


Product/Custom Detail = 
VAR temp =
    SUMMARIZE (
        ALLSELECTED ( Table1 ),
        [customer_id],
        "Product Combo", CONCATENATEX ( VALUES ( Table1[product] ), [product], "," )
    )
VAR t2 =
    SUMMARIZE (
        temp,
        [Product Combo],
        "Customer list", CONCATENATEX (
            FILTER ( temp, [Product Combo] = EARLIER ( [Product Combo] ) ),
            [customer_id],
            ","
        )
    )
RETURN
    CONCATENATEX ( t2, [Product Combo] & ":" & [Customer list], "|" )

8.PNG

9.PNG

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors