I can currently get a total distinct count of customer ID's per product, such as "A=3 distinct customers". What I want to be able to do is show the amount of distinct customers in all possible combinations of products. So it should display the following:

Product Combinations

Count of Distinct Customers with the product combination

A Only

1

B Only

0

C Only

1

A and B

1

A and C

0

B and C

0

A, B, and C

1

Would anyone be able to assist me in displaying these different totals?

Fun question . Create a field in your data set that assigns each customer ID to its product combination, using a FIXED level of detail (LOD) expression. Personally, I would create a new field that assigns each product a power of two (A=1, B=2, C=4, etc.), then sum that field in a new calculation (the FIXED LOD) to get a unique ID for each customer's product combination. You could use aliases to make the numbers have the labels that you want. Finally, use this new field (converted to a dimension) to count the distinct number of customer IDs assigned to each of your product combinations.

Suppose you assign A=1, B=2, and C=4 to a new field called [Product Code]. Then notice that if you add up all of the product codes for each customer, the resulting number will tell you exactly which combination of products the customer had. For example, Mark had products A and B, so SUM([Product Code]) for that customer would be 3. The only way to get a SUM([Product Code]) of 3 is to have products A and B. So if you put just [Customer ID] into the Rows shelf and put SUM([Product Code]) as text marks, you get the number corresponding to whatever product category each customer ID is assigned to.

Now we want to use SUM([Product Code]) as a dimension / category as opposed to a measure, and count how many customer IDs have that code. Your marks are going to need to be COUNTD([Customer ID]), but first you need some way to turn SUM([Product Code]) into a dimension. That is where FIXED LOD expressions come in. We write the calculated field

[Combination Codes] : {FIXED [Customer ID] : SUM([Product Code])}

What this does is tell Tableau to calculate SUM([Product Code]) as if only [Customer ID] was on the Rows shelf, then go through each row of your data and assign as a value in [Combination Codes] the SUM([Product Code]) associated with the corresponding [Customer ID]. Tableau will then allow you to use this new field as a dimension, so you can aggregate customer IDs by [Combination Codes] values.

With a bit of reformatting (and a blend in case you wanted all of the codes, not just ones with data), you get the attached workbook.

I ran into an additional problem where a customer could have more than one of each product, so if they had 2 of product A and 1 of product B, the SUM would no longer be correct. For anyone referencing this post, here was the solution.

I created a calculated field called "Combination Calculation"

IF [Product]="A" THEN 1

ELSEIF [Product]="B" THEN 3

ELSEIF [Product]="C" THEN 5

END

I then created a calculated field called "Different Combinations" very similar to yours, but included MIN to resolve the issue of customers having more than 1 of a given product type.