Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
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
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.