4 Replies Latest reply on Aug 19, 2016 5:44 AM by Muhammad Khan

# Correction needed in my formula

Hello Everyone

A quick question, I have 4 measures  with range of 1 to 100 in which 60 is passing marks. which formula should I use to show pass and fail separately for every individual student ? When I am filtering it with range values then it applies to entire measures.

Measures

Course 01  Values 1 , 2, 3 ......100

Course 02 Values 1 , 2, 3 ......100

Course 03 Values 1 , 2, 3 ......100

Course 04 Values 1 , 2, 3 ......100

I want to calculate pass and fail for every individual student. I used below formula but it is not working

Pass Student (COUNT([Course 01] >= 60))

Fail Students  (COUNT([Course 01] < 60))

your help in this regard will be highly appreciated.

Thanks

• ###### 1. Re: Correction needed in my formula

what happens if you make one calculated field like

if [Course 01] >= 60 then 'Pass' else 'Fail' end

• ###### 2. Re: Correction needed in my formula

I don't know about your data structure. As you mentioned you've four measures. So I've tried to create the same data set like yours. Lets assume If you've data set like this.

It will be more easy If you reconstruct your data. Try to transpose your measures into columns.

You can get the above format in Tableau using Pivot. Then you can write an IF..ELSE..END statement to get the desired output. If you use above format then you can try something like this

Result 1:

Result 2:

Result 3:

Let me know If you've any query.

Mahfooj

1 of 1 people found this helpful
• ###### 3. Re: Correction needed in my formula

Hello Mahfooj Khan

Thank you so much for your response, your approach is 100 % correct but I want to display marks instead of Pass / Fail flag.

I am trying to do it in following way

 Class Number of students Course 1 Passed by Course 1 Flailed by Course 2 Passed by Course 2 Fail by Class 1 44 22 22 21 23 Class 2 10 10 0 10 0 Class 3 22 2 20 18 2 Class 4 33 33 0 33 0 Class 5 15 10 5 11 4 Class 6 10 10 10 10 10

I am really confused how to figure it out, if you want i can share my data source with you.

Thanks

• ###### 4. Re: Correction needed in my formula

Hello Mahfooj Khan

This formula will work for me but it needs some correction

COUNT(IIF ([Course 01]) <= 59  THEN [Total Enrolled] END

Both fields are measures.

Thanks