



It’s going to iterate through every single customer and see if that customer also bought the product that we select in the Product Selection slicer. The ALL Products releases or gets rid of the Products filter, and then USERELATIONSHIP is going to turn on that other filter that has an inactive relationship. What VALUES does here is it creates a column table of all the unique people or customers that have bought product 1. So for instance, we go with product 1, the filter is placed onto the Sales table. We’re utilizing CALCULATETABLE, which is a table filter. I’ve put an entire table filter inside this variable and called it Multi Purchase Evaluation. I’ve used variables as effectively as I possibly can. There’s a little bit to this formula with complex DAX functions. Let’s look at the formula behind all these to have a better understanding of the results. What changes is this Customers With Both Products table because this formula evaluates the products (Product Selection slicer) and shows how many times it was bought with other products (Product Name table). So from our initial selection, this does nothing to the Customers Who Bought column. The Product Selection slicer comes from the Filter Products we have in our model, which has an inactive relationship. So for product 1, there are 135 people who bought it in 2016 while 128 people bought product 15 and so on. This table simply shows how many people bought the products shown in the Product Name table in 2016, as we have this filtered on 2016. However, this Customers Who Bought table here does not relate to our Product Selection table. The Product Selection table allows us to select a product and see how many times this product has been bought with other products. Now let’s look at what the result is actually doing. Evaluating Cross Selling Opportunities With Basket Analysis It’s how we manage these filters or contexts within a formula that is going to allow us to achieve the result. We’re going to work with some different contexts that will be applied from these two tables. Here, we can see that the relationship is ‘inactive’. We have our Products table and we have our Filter Products table. We evaluate whether a particular product is bought with another product, and that’s why we have to create this model. So there are two filters in operation here: the filter on the product we select, and the filter on every single other product. For instance, if we want to see how many times product 5 has been bought compared to other products, we will filter/select product 5. But then we’ll also filter another product. In this Basket Analysis example, we need to filter a particular product. We have to specifically build our model for this type of analysis.

The first thing that we need to do is to adjust our model. That’s only if it doesn’t immediately make sense how it all fits together. What I would recommend here though is to gain exposure to it initially, and then review it over time, as you learn more about each individual function. I did say this is advanced and it is very difficult to get your head around all the different elements within each formula. I go into quite a bit of detail regarding the DAX formulas that you need to implement. What I’m going to go into here is how you can use this type of analysis to evaluate cross selling opportunities within your data sets.
