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 2,577 views

## 1 answer to this question.

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.

• 33,050 points

## How can I download tableau workbook with its data from tableau server?

In essence, no. Since the workbook is ...READ MORE

## 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

## How can I count the aggregate function in Tableau

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

## How to determine average per event by year?

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

## Calculating count average from averages

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

## How to return the value on which the condition is met for the first time?

It looks like you are trying to ...READ MORE

## How to Split a Measure in Tableau?

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