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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.