7 Replies Latest reply on May 3, 2018 6:32 AM by Zhouyi Zhang

    Calculated field with date using an aggregation measure

    Jemma Ayre

      Not sure how to fix this issue.

       

      I have managed to stop the "cannot mix aggregate and non-aggregate comparisons or results in 'case' expression" in the first calculated measure "Metric Chooser" by applying sum.

       

      Metric Chooser

      if [Parameters].[Metric Chooser]= 'Sessions' THEN SUM([Sessions])

      ELSEIF [Parameters].[Metric Chooser]= 'Transactions' THEN SUM([Total Transactions])

      ELSEIF [Parameters].[Metric Chooser]= 'Revenue' THEN SUM([Total Revenue])

      ELSEIF [Parameters].[Metric Chooser]= 'ConvRate' THEN [ConvRate]

      END

       

      However, another measure we use references this measure below for "Current Year" but I am getting the cannot mix aggregate measure. How can I change the below-calculated measure the will enable it to work?

       

      Current Year

      IF Month([Date])=MONTH([Order Date Parameter]) and

      (year([Date]))=year([Order Date Parameter]) then [Metric Chooser] END

       

      Thanks