2 Replies Latest reply on Jul 13, 2016 2:47 PM by Maddy Pena

    Percentage per row

    Maddy Pena

      Hi guys!

      I've search on many topics about this particular situation and I can't understand why it is showing this way. What I want to do is this:

       

      I want to show the percentage of turnover per BU, in excel it would be Turnover Count / Headcount (of BU) *100:

       

      But when I try to do the same thing in Tableau, my results are these but I don't know why:

       

      How can I show the same results as the first image?

      I've attached a package workbook with sample data.

       

      Hope you can help me! thank you all!

        • 1. Re: Percentage per row
          Kenneth McBride

          Maddy,

           

          You need to edit your calculated field for Turnover % and wrap each of the two metrics (headcount and turnover count) in a SUM(). So this:

          SUM([Turnover Count])/SUM([Headcount])*100

           

          The issue is the way you currently have it calculated it does Turnover Count / Headcount for every single row and then sums the answers which is producing some nulls because some of your rows have nulls for one or both of those fields. By moving the addition, SUM(), inside your calculated field you will be adding up all the turnover counts and all the headcounts and then dividing those two numbers.

           

          Your calculation is a row level calculation and it needs to be an aggregated calculation. Let me know if that works for you.

           

          Ken

          1 of 1 people found this helpful
          • 2. Re: Percentage per row
            Maddy Pena

            Thank you Kenneth!

            For some reason, Tableau was rounding up the results, and I was seeing this:

             

             

            I change the number format, and now I can see the results I was expecting:

             

             

            Thank you so much!