top of page

Market Basket Analysis in Tableau

a person making a purchase online

What is Market Basket Analysis?

Market basket analysis is a data‑mining technique used to uncover patterns in how products are purchased together. At its core, it examines large volumes of transactional data to identify associations - such as which items frequently co‑occur in the same shopping basket. These relationships are often expressed through metrics like support, confidence, and lift, which help quantify how strong or meaningful the product affinities are. The method is widely used in retail and e‑commerce, but its logic applies anywhere items or events occur in combinations.

The real value of basket analysis lies in turning these patterns into practical actions. Retailers use it to optimize product placement, design cross‑sell strategies, personalize recommendations, and improve promotions. Analysts can also use it to understand customer behaviour at a deeper level - revealing hidden connections that aren’t obvious from simple sales totals.

Step-by-Step Guide

Using the Sample-Superstore dataset, connect the orders table and do a self-join between the tables as shown below.

setting the data connection (model) in Tableau data source page

(Note, I am joining the tables on Order ID and Sub-Category as shown above)

Next…

  • Drag Sub-Category to the columns shelf.

  • Drag Sub-Category (Orders1) to the rows shelf.

  • Add Count Distinct CNTD(Order ID) to the Text and Color shelf.

  • Change the marks card to Square.

sample visualization - a heatmap

Create a calculation “Filter” as shown below to remove duplicate pairings.

tableau calculated field

Drag the calculation to the filters card and select TRUE. See the resulting view.

final view, a heatmap showing product association

This results in a heatmap, with each cell representing a pair of items, and the color intensity reflecting the number of orders that contained both items.

Conclusion

Market basket analysis in Tableau offers a practical, visually intuitive way to uncover product affinities and customer purchasing patterns, enabling analysts and business teams to move from raw transaction data to actionable insights with ease. By combining association rules with Tableau’s interactive dashboards, organizations can quickly identify high‑value product bundles, optimize store layouts, refine promotions, and enhance cross‑sell strategies. Ultimately, the strength of this approach lies in its ability to translate complex relationships into clear, data‑driven decisions that improve both customer experience and business performance.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

WhatsApp: +254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page