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 in Tableau by Nithin

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by CHERUKURI
• 13,940 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 28, 2018 in Tableau by Atul
• 5,470 points
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 5, 2018 in Tableau by Atul
• 10,200 points
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
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
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
• 830 points
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 in Tableau by CHERUKURI
• 13,940 points
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.