3 Replies Latest reply on Feb 28, 2018 3:22 PM by Deepak Rai

    Comparing Values to Overall Average


      Hi All!


      I have a dataset of Instagram posts that I've stood up in Tableau. Data is confidential, thus I cannot provide the workbook. However, I've simplified the dataset below.


      CaptionLabels (Or Categories)Engagement
      I love puppies!Pets, Dogs, Photo12
      Check out this cute cat!Pets, Cat, Video9
      I still have a goldfish.Pets, Fish, Photo9


      Note that the average engagement on a per post level is 10.


      I want to be able to create a calculated field that fundamentally compares the average engagement of a category (I've already got this step done) to the per-post average. In this case, it should spit out that Photos perform 5% above average. 


      Label/CategoryAverage EngagementPercent Above Average Engagement


      Any help is greatly appreciated! Thanks!

        • 1. Re: Comparing Values to Overall Average
          Deepak Rai

          Hi Simone,

          Here is the Solution, See attached and If it Helps, Please mark it Helpful and CORRECT to Close Thread.




          1 of 1 people found this helpful
          • 2. Re: Comparing Values to Overall Average
            Norbert Maijoor

            Hi Simone,



            In addition to directions provided by Deepak Rai find my approach as reference below and stored in attached workbook version 10.3 located in the original thread.



            1. Define a UNION with the amount of table based on the amount of words you are looking for



            2. NM D1. Label:

            if [Table Name]='Sheet1' and CONTAINS([Labels (Or Categories)],"Pets") then "Pets"

            elseif [Table Name]='Sheet1$' and CONTAINS([Labels (Or Categories)],"Cat") then "Cat"

            elseif [Table Name]='Sheet11' and CONTAINS([Labels (Or Categories)],"Dogs") then "Dogs"

            elseif [Table Name]='Sheet12' and CONTAINS([Labels (Or Categories)],"Video") then "Video"

            elseif [Table Name]='Sheet13' and CONTAINS([Labels (Or Categories)],"Fish") then "Fish"

            elseif [Table Name]='Sheet14' and CONTAINS([Labels (Or Categories)],"Photo") then "Photo"



            3. NM M1. Engagement: sum([Engagement])/sum([Number of Records])


            4. Drag the required objects to the indicated locations.



            5. Add the reference line






            • 3. Re: Comparing Values to Overall Average
              Deepak Rai

              Hi Simone,

              If it Worked for you , can you close Thread by marking my Answer as CORRECT from main thread, not in email.