2 Replies Latest reply on Jan 10, 2019 10:13 AM by Kyle Boyce

    SUM for Target Achieved aggregation

    Salamon Musayev



      I am new to Tableau and I am running into an issue that Im hoping you can help me.  I would like to show the Number of Metrics that Have Achieved their Targets. 


      I have the following columns; User, Metric, Performed, Denominator, Target (see table below)


      John DoeMetricA11.75
      John DoeMetricB11.80
      John DoeMetricB01.80


      In Tableau I am able to create calculated fields

      Rate =  Sum(Performed) / Sum(Denominator)

      Metric_Target = Avg(Target)


      Based on the following I can create a table where I can see which of my Users Rate as well if they have passed their target


      MetricRateMetric Target


      I can also create calculated field to flag if the Metric has achieved its target by using the following formula


      MetricAchieved = IIF( ((SUM([PERFORMED])/SUM([Denominator]))) >= (AVG([TARGET])),1,0)


      What I am having an issue with is that I would like to show as a KPI the number Metric Have Achieved their Target


      I was hoping that I could Use the following formula Sum(MetricAchieved) HOWEVER I get the following error


      Argument to SUM is already an aggregation function and cannot further be aggregated.


      What I am hoping my end result to be is to have a Pie Chart that would 1/2 Metrics Met


      Please help if you can. 

      Thank you