Tableau count average from averages

0 votes

There is some data:

A, B, C (where C = A/B)
10, 20, 0.5
10, 100, 0.1

There are two ways of counting the average C:

  • First is sum(A)/sum(B), that gives C equal 20/120=0.1666

This is Tableau: sum([A])/sum([B])

  • Second is avg(C), that gives C equal (0.5+0.1)/2=0.3

This is in Tableau: No Idea...

Both have different usages. I need the second one, but can't find a way to calculate it. Anything I try, I always get the first type.

Mar 13, 2019 in Tableau by Nithin
3,106 views

1 answer to this question.

0 votes

Hi Nithin,

1. You create a calculated field to provide value of C for every row. 

  • write the code as  DIV([A],[B]) then you will get C for every row. ( Here A, B  should be Integer to use DIV() else convert to integer i.e  DIV(INT([A])/INT([B])) .

2. Then Apply average on the field C to get the output as your second way just like performing average on fields.

Hope this helps you.

answered Mar 13, 2019 by Cherukuri
• 33,030 points

Related Questions In Tableau

+2 votes
1 answer
0 votes
0 answers

How to export the IdP (Identity provider) XML Metadata from Keycloak which is imported to Tableau?

Keycloak version 1.6.1, Goal: Keycloak should act ...READ MORE

Mar 29, 2018 in Tableau by ffdfd
• 5,550 points
2,324 views
0 votes
1 answer

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

answered Apr 6, 2018 in Tableau by Atul
• 10,240 points
5,648 views
0 votes
1 answer
0 votes
1 answer

How to determine average per event by year?

Hi Roshan, Create a new calculated field (use ...READ MORE

answered Sep 25, 2018 in Tableau by Machdata
• 340 points
863 views
0 votes
0 answers

Calculating count average from averages

I've a calculated field in Tableau which ...READ MORE

May 28, 2018 in Tableau by Mahima Choudhary
469 views
0 votes
1 answer
0 votes
1 answer

How to Split a Measure in Tableau?

Have you tried using an IF statement: IF ...READ MORE

answered Aug 14, 2018 in Tableau by AwesomeSauce
• 860 points
2,053 views
0 votes
1 answer

how to generate random numbers and row-count in Tableau

Hi, You can create random numbers using a ...READ MORE

answered Mar 13, 2019 in Tableau by Cherukuri
• 33,030 points
18,412 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP