4 Replies Latest reply on Sep 5, 2018 6:31 AM by Ankit Bansal

    Dynamic Max date in IF statement

    Roger Hawaibam

      Hi All,


      Data has 2 dimensions i.e Month(date format)  & Monthplaceholder (str) and 1 measure i.e Sales.

      I have created calculated filed named calculation 1.  Query is


        IF [Month Placeholder] ='Aug' the [Sales] END     this is fine.


      What I want is [Month Placeholder] =MAX(Month)     .



      So, I have written an query IF [Month Placeholder]=(LEFT( DATENAME('month',MAX([Month])),3)) THEN [Sales] END  then its showing error "can't mix aggregate & Nonaggregate.....




      max date.PNG


      Thank you in advance