4 Replies Latest reply: Aug 1, 2017 11:13 AM by Siddharth Sheshadri RSS

    Measure not working as desired

    Siddharth Sheshadri

      Hi all,

       

      I have the below measure with set analysis:

       

      SUM({<[CloseDate]={'>=$(vMaxDateLastMonthStart)<=$(vMaxDateLastMonthEnd)'}>}Sales)

       

      vMaxDateLastMonthStart: =date(num(Monthstart(MonthStart(max(CloseDate))-1)))

      vMaxDateLastMonthEnd: =date(num(MonthStart(max(CloseDate))-1))

       

      The measure works fine when I select this month but when I select last month, the measure becomes zero.

      The date variables however are fine. I.e. when I select say July, vMaxDateLastMonthStart shows June 1st & vMaxDateLastMonthEnd shows June 30th.

       

      Is there anything wrong with my set analysis? How come it works only for the current month but the previous months become zero.

       

      Regards,

      SS.