1 Reply Latest reply: Nov 7, 2018 10:50 AM by Sunny Talwar RSS

    Get Previous Months value

    ruti t

      Hi everyone,

       

      I try to create measure that display the avg of sales where field InsertDate equal to user selection minus one month (get the values of previous month)


      avg({<InsertDate=,InsertMonth=,InsertYear=,Status={'Active'},InsertDate={">=$(=MonthStart(addMonths(max(InsertDate),-1)))).

      <=$(=MonthEnd(addMonths(max(InsertDate),-1)))"}>}Sales)

       

      Could you please advise?

       

      Thank you!!

        • Re: Get Previous Months value
          Sunny Talwar

          Remove InsertDate= from the beginning of your set analysis expression and see if that fixes the issue

           

          Avg({<InsertMonth, InsertYear, Status = {'Active'}, InsertDate = {">=$(=MonthStart(AddMonths(Max(InsertDate), -1))))

          <=$(=MonthEnd(AddMonths(Max(InsertDate), -1)))"}>} Sales)