Forum Discussion
Customers who bought multiple products
Hi everyone. Worked on a little problem recently to try and figure out "customers who bought combinations of products". I have seen plenty of posts and great patterns on Basket Analysis (e.g. DAX Patterns, Chris Webb etc.) but they were always about a max of two products and used a pattern with multiple 'dimension' tables and meant you had to deal with inactive relationships.
We found a nice way of simplifying this so with one slicer you can select a few products and see how many people bought all of those products, and how many bought any of them:
You can get the pbix file here:
https://1drv.ms/u/s!AhrHQG3fCq7Rsu0Z8MhPKuWN3nkt6A
Hope you find it useful!
10 Replies
- Vvelarde
Community Champion
Hi, In the PowerBI Sample you can't select more than 1 product.
EDIT: Sorry, Its correct.
- Sean
Community Champion
Here's the Measure for everyone to see!
Buyers of All Selected Products = IF ( ISBLANK ( COUNTROWS ( FILTER ( SUMMARIZE ( Sales, Sales[Customer], "ProductsBought", DISTINCTCOUNT ( Sales[Product] ) ), [ProductsBought] = COUNTROWS ( VALUES ( Sales[Product] ) ) ) ) ), 0, COUNTROWS ( FILTER ( SUMMARIZE ( Sales, Sales[Customer], "ProductsBought", DISTINCTCOUNT ( Sales[Product] ) ), [ProductsBought] = COUNTROWS ( VALUES ( Sales[Product] ) ) ) ) )Thanks to WillT :smileyhappy:
- KrishnaKalyanRegular Visitor
Hi,
I have a similar request, but my users want to see the customer list and the amounts per product as well in a pivot table
My data has Columns: Year, Customer No, Customer Name, Product, and Amount.
I'm thinking if I can get a unique customer list in a calculated table dynamically based on the product selection and year selection, I can use the relations between the table and get the visualizations working.
Could someone kindly help in getting this dynamic table? Even if anyone has a better solution, I would be more than happy to take it.
Thank You & Regards,
Krishna Kalyan