6 Replies Latest reply on Jul 28, 2017 7:40 AM by Mateo Abrecht

# Adding average to a total row (doesn´t works)

Dear all,

I have the following problem. I want the total of this row to show me the average and I don´t know why, when I select Analysis > Totals > Total all Using > Average it doesn´t works.

Find attached the project and if you can help me I´d be grateful.

Thank you!

• ###### 1. Re: Adding average to a total row (doesn´t works)

Hi - I couldn't open your workbook as it uses a latest version of tableau than mine. I use 10.1.

I used the superstore data set to create the avg for the Total. The grand total in the first column, in the attached image, is the total using Average and the second grand total is Sum.

The steps you identified are the same I used.

• ###### 2. Re: Adding average to a total row (doesn´t works)

Thank you for your answer Katha but the problem I´m having I believe is more complex since I have lots of caclulated fields and you should need the file I´ve attached to understand the situation.

Regards!

• ###### 3. Re: Adding average to a total row (doesn´t works)

I'm not sure why you're using the calculation you are for Zeros, but why not something like:
SUM([Amount USD])

If you have nulls in the data, try: SUM(ZN([Amount USD])

The table calculation isn't really helping much here and is the cause of the totaling issue. If you use one of the above calculations, you should just be able to total using an average by going to
Analysis -> Totals -> Total all using -> Average

1 of 1 people found this helpful
• ###### 4. Re: Adding average to a total row (doesn´t works)

I need the calculation ZN(LOOKUP(SUM(ZN([Amount USD])),0)) for Zeros because sometimes I have empty values and I wnat Tableau to complete them with "0".

Is it possible to change this formula and have the same result?

Regards Ben!

• ###### 5. Re: Adding average to a total row (doesn´t works)

Empty or non-existent? There's an important difference. If it's just an empty cell or null value in your spreadsheet/DB, use my second calculation with the SUM(ZN and it should accomplish the same thing.

• ###### 6. Re: Adding average to a total row (doesn´t works)

Ben,

I have non-existent. For example I have the month 12/09/2016 that there hasn´t been any Delay in invoice, so I don´t have that date in my base, but I want Tableau to put zeros in that case.

Regards