How to divide one measure by another?

0 votes

Sample Dataset:

school  student marks
a       xyz      5
a       xyz      10
a       abc      15
b       cde      20
b       cde      25
a       cde      30

Goal: Find total marks, count of marks and average marks by student and school

Query: How can I create the 4th column when 2nd and 3rd columns are measures. Is it possible to perform a row level calculation?

student sum of marks    count of marks  average marks
xyz      15              2               7.5
abc      15              1               15
cde      75              3               25

school  sum of marks    count of marks  average marks
a       60              4               15
b       55              2               27.5
Apr 10, 2018 in Tableau by ghost
• 1,790 points
17 views

1 answer to this question.

0 votes

Yes it is possible,

Option 1:

Create a calculated field as "average marks":

SUM(marks)/COUNT(marks)
 

Option 2:

Right click the measure and select average from the options instead of sum or count.

answered Apr 10, 2018 by Atul
• 5,530 points

Related Questions In Tableau

0 votes
1 answer

How to sort by any measure in a Tableau table?

Hi Sindhu, Once you have created a bar ...READ MORE

answered Mar 8 in Tableau by Cherukuri
• 17,870 points
148 views
0 votes
1 answer

How to split or divide the grouped data into multiple graphs?

One of a simple approach is to ...READ MORE

answered Apr 17, 2018 in Tableau by xyz
• 1,550 points
28 views
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
44 views
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
66 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
1,359 views
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
50 views
+2 votes
1 answer
0 votes
1 answer

Reset filters in Tableau

I understood your question (I hope so!). ...READ MORE

answered Mar 29, 2018 in Tableau by QueenBee
• 1,810 points
415 views
+1 vote
1 answer
0 votes
1 answer

How can I use Tableau to create a heatmap?

Step 1: Create an Excel Spreadsheet with ...READ MORE

answered Apr 2, 2018 in Tableau by Atul
• 5,530 points
491 views