3 Replies Latest reply on Dec 20, 2016 2:18 PM by Shinichiro Murakami

# Average of a sum across sets

Workbook attached.

I'm breaking up my data by how many product lines a customer has purchased.

I want to know, for each grouping, say of "customers that have purchased 5 products", what their total average sales is per customer.  So answering the question, do customers that have purchased 5 products have higher average sales than customers that purchase only 1 product?

I would think "WINDOW_AVG(SUM(sales_amount))"  calculated across "how many products used" would work, but it is not.

• ###### 1. Re: Average of a sum across sets

Hi Christopher,

See if this gets you what you need:

I used your attached workbook and

• dragged "How many products.." to columns
• dragged "average sales sum" to rows

This provides the average sales amounts for customers who bought 1-5 products.

Please let me know if you are looking for something else.

Thank you for using Tableau!

Angie

• ###### 2. Re: Average of a sum across sets

(Note to self:  V10.0 workbook.)

See the attached.  First sheet.  I put the values in tooltips.

• ###### 3. Re: Average of a sum across sets

Hi Christopher,

Here is my approach.

[Group]

str({fixed [Customer Number1]:countd([Product Line Descr])})+" Product"

[Average Sales Sum 2]

{include [Customer Number1]:(sum([Sales Amount]))}

Thanks,

Shin