3 Replies Latest reply on Aug 28, 2018 2:22 PM by Okechukwu Ossai

    Calculate % in Tableau

    Tonia Spring

      I am trying to create a calculation to indicate the % of each referral status.  I have attached the Report I am using with the HIPAA info deleted and the Tableau Report.  On the tab Pending Summary All Regions, I have calculated the different statuses of each referral and now would like to add the % of each of those statuses based on the Count of Referral/Call received.  Any assistance would be greatly appreciated.  Thank you.

        • 1. Re: Calculate % in Tableau
          Okechukwu Ossai

          Hi Tonia,

           

          Since each status is a calculated field (measures), it will be difficult to calculate the %s and add them as a column next to each status. An alternative approach will be to change the calculated measures to dimensions. Total count of referral/call received is an LOD fixed to the entire dataset, so all filters must be added to context if they are required to affect the calculations. I have added AAA region1 to context.

           

           

           

           

           

          Right click on AAA region1 on the filter shelf and select 'Add to Context'.

           

          Hope this helps.

          Ossai

          • 2. Re: Calculate % in Tableau
            Tonia Spring

            I was able to recreate your results, but when I separate the info out by grouped region the % calculate by the total number of referrals and not just by the total referrals for that region.  Any suggestions?  I added my workbook.  Thank you again.

            • 3. Re: Calculate % in Tableau
              Okechukwu Ossai

              You are almost there. The AAA region1 filter should be added to context. This is required because the denominator of the [% Status] formula is an LOD expression.

               

              FIXED LOD expressions are not affected by quick filters except they are added to context. This is because FIXED LODs are higher in Tableau's order of operations and are computed first before quick filters are executed. Another way to make FIXED LODs responsive to quick filters is to add the relevant fields to the LOD formula.

               

               

              In the 'AAA1-4 Summary w %' sheet, right click on [AAA region1] on the filter shelf and select 'Add to Context'. The filter will become grey.  You can also right click and select 'Remove from Context' if you wish to remove the filter from context.

               

               

              Hope this helps.

              Ossai