6 Replies Latest reply on Sep 3, 2012 7:10 AM by Joe Smith

# how to calculate area-weighted average in Tableau

Hi, the area-weighted average is explained in the image below. May I ask how to do this calculation in Tableau?

- Ji

• ###### 1. Re: how to calculate area-weighted average in Tableau

I'll assume you have a data set just like the Table in your included image.

If you are trying to display the 18.89 area-weighted average in a table as a "Grand Total" of the columns would appear, I'm not sure I know how to do that.

But I think you could get a single-line table view.

Create a calculated field:

[Area-Weighted Avg] =  SUM([Temperature]*[Area])/ SUM([Area])

If you wanted the value to be able to be displayed as an additional column FOR EACH ROW, you could create an alternate calculated field:

//wasn't able to test this, so it'll likely use one of these variations

[Total Area-Weighted Avg]  = TOTAL(SUM([Temperature]*[Area]) / SUM([Area]))

[Total Area-Weighted Avg]  = TOTAL(SUM([Temperature]*[Area]))  /   TOTAL(SUM([Area]))

1 of 1 people found this helpful
• ###### 2. Re: how to calculate area-weighted average in Tableau

Thanks a lot, Mark! will try out accordingly.

- Ji

• ###### 3. Re: how to calculate area-weighted average in Tableau

sorry, the area-weighted average temperature as shown in the example in my first post is not correct!

It should be 23.33.

- Ji

• ###### 4. Re: how to calculate area-weighted average in Tableau

here are the results:

• ###### 5. Re: how to calculate area-weighted average in Tableau

Hi Joe,

Are you still looking for help on this? If so, you're going to need to post a packaged workbook (.twbx), the .twb files don't actually include your data.

Jonathan

• ###### 6. Re: how to calculate area-weighted average in Tableau

Hi, Jonathan, I've figured it out. Here's a new example file.

- Ji