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

    Correction needed in my formula

    Muhammad Khan

      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.




      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.






        • 1. Re: Correction needed in my formula
          corey levinson

          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
            Mahfooj Khan

            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.




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

              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



              ClassNumber of students Course 1 Passed byCourse 1 Flailed byCourse 2 Passed byCourse 2 Fail by
              Class 14422222123
              Class 210100100
              Class 322220182
              Class 433330330
              Class 515105114
              Class 61010101010


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






              • 4. Re: Correction needed in my formula
                Muhammad Khan

                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.