3 Replies Latest reply on Jul 19, 2018 4:14 AM by Ankit Bansal

    Creating new measure with if expression but combine AGG and NON-AGG

    Saharat Sakulsaowapakkul

      Hi everyone

       

      Let's start with 3 dimensions which are [Store], [Store Status], MONTH[Date] and 1 measure which is [Sales]

       

      I already created 2 new measure which are [Target Sales for EXISTING Store] and [Target Sales for NEW Store]

       

      They have different calculation. The statuses of "EXISTING" or "NEW" are identified by [Store Status]

       

      I would like to created another measure called [Target Sales] so that I can create 1 dashboard combining both type of stores.

       

      My ideal logic under [Target Sales] is

       

      IF [Store Status] = "EXISTING"

      THEN [Target Sales EXISTING Store]

      ELSE [Target Sales for NEW Store]

      END

       

      But I got an error message Cannot mix aggreegate and non-aggregate comparisons or results in "IF" expressions.

      You guys may kindly give me an idea here or else revise my attached workbook package.