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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
zhichengyang
Regular Visitor

How do I calculate top complementary products customer bought in a single transaction?

I don't know it is accurate enough to describe my need.

I am pretty fresh and still learning to use Power BI. So I greatly appreciate your help and would like to spend time in understanding your reply!

 

Our store sells cheap products so people generally buy 2 or 3 products together.

So I need to know when people buy a certain product, which products they would like to buy most.

The table I currently have:

Table 1: Current All Time Sales, I have columns include [Store Number], [Transaction Code], [Product SKU], [Quantity Sold]

Table 2: Product Information, I have columns include [Product SKU], [Product Name], [Product Category], [Product Subcategory]

Table 3: Store Information, I have columns include [Store Number], [Store Name], [Store Category]

 

Note that each transaction code is unique like transaction code 20170401004000a01 represents a single transaction happened for a customer, he or she might buy 2 or more products in this transaction. So a transaction code could contain 2 or more product SKUs.

 

I built the relationship between 3 tables, I can filter 'Current All Time Sales' by 'Product Information' and 'Store Information'

I need to display two features:

 

1. To show what is the most frequent products people bought together, and rank it in a readable way.

 

2. By selecting a Product SKU, I can see the all the products people bought together when people bought this product.

 

I'll try to attach the image to illustrate better ASAP. And please ask me anything if you need more information.

2 REPLIES 2
OwenAuger
Super User
Super User

@zhichengyang

What you have described falls under the category of "basket analysis".

Have a look here for some patterns that could be adapted to your needs:

https://www.daxpatterns.com/basket-analysis/

 

It would be good to see some sample data & expected outputs (even small tables) to give some concrete suggestions.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @zhichengyang,

Could you please post me some sample data or share the pbix file if possible and could you post me your desired picture?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.