6 Replies Latest reply on Jan 4, 2018 4:12 AM by Zhouyi Zhang

    Pie chart percentages not adding up to 100

    Anshul Sharma

      Hello,   i have prepared a Donut chart by using dual axis, i have 5 brands in my data and their percentages does not add to 100 because we do not have data for the rest of the brands now my lead wants to display a separate category within this donut chart as 'Others' which will have the value (100-SUM(brand1 to brand5)) so that when the percentages are added they will sum up to 100. i have attached the workbook. 

       

      Note: i am using an older version(9.3) of tableau desktop.

      please suggest.

       

      thanks

        • 1. Re: Pie chart percentages not adding up to 100
          Zhouyi Zhang

          Hi, Anshul

           

          Is it possible to add one more row in your data set with Attributes "Other" as shown below?

           

           

          ZZ

          1 of 1 people found this helpful
          • 2. Re: Pie chart percentages not adding up to 100
            Anshul Sharma

            Hi ZZ,

             

            Thanks a lot for replying,

            its only a very very small subset of the data, the original data contains millions of rows. so inserting the rows is out of the question.

            I am trying a different approach, using LOD expressions i am able to calculate the sum of the values which are being displayed in the chart {INCLUDE [Attributes]: SUM([Value])}

            if I select or deselect a brand(Attribute) the value changes accordingly.

             

            After this I am trying to subtract this sum from 100 to get the desired value and this is where i get stuck, this subtraction (100-[LOD_include]) is not giving the correct value.

             

            I am attaching the workbook, can you tweak this expression or suggest what i am missing so i get the correct value.

             

            Thanks

            Anshul

            • 3. Re: Pie chart percentages not adding up to 100
              Zhouyi Zhang

              Hi, Anshul

               

              The only way without reshape your data I could think of is to create a parameter for year selection

               

              and then create 2 calculation fields

              drag these two calculation fields to details as shown below

               

              another result, with maestro filtered

               

              I don't have 9.3 installed, so please follow the steps above and let me know if you have question

               

              ZZ

              2 of 2 people found this helpful
              • 4. Re: Pie chart percentages not adding up to 100
                Anshul Sharma

                Hi ZZ,

                 

                Amazing, thanks a lot. i have tried this and it is working exactly as i wanted.

                i have couple of  questions, first is, in the If else statement the else condition should never be true because year parameter will never have a value other than what is present in data so how others is getting displayed???.

                 

                second one is, i have many more columns from where i am filtering the data and facing problem in implementing this in my actual dashboard. I am attaching an excel file which is matching the structure of the data but has only few of the rows. can you suggest which column should i use in the LOD expression to make it work.

                 

                thanks

                • 5. Re: Pie chart percentages not adding up to 100
                  Anshul Sharma

                  Hi ZZ,

                   

                  i figured out how to implement this in my actual dashboard, the solution was, i had to put all the relevant filters in context and it worked.

                   

                  Still i am not able to figure out the if else statement, can you please shed some more light on to that.

                  • 6. Re: Pie chart percentages not adding up to 100
                    Zhouyi Zhang

                    Hi, Anshul

                     

                    It will fall into else statement as using the parameter doesn't mean filter all the other year out, it just categorizes current year's attributes and the rest years all together as "Others", and the same you will the second calculation uses the value as you want 100-x.

                     

                    ZZ