Showing results for 
Search instead for 
Did you mean: 
zhichengyang 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.

Microsoft v-danhe-msft

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

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?



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.
OwenAuger Super Contributor
Super Contributor

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


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:


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




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Helpful resources

New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)