This content has been marked as final. Show 3 replies
I am looking to find number of orders (month to date) in the previous month of the selected/current month. I am using a calc. field to calculate previous month orders as :
Previous month Orders (mtd):
COUNTD(IF( DATEPART('day',[Order Date]) < DATEPART('day',TODAY()) AND YEAR([Order Date]) = [Current Year]
AND MONTH([Order Date ]) = [Current Month]-1) then [OrderID] END)
The above calculation works fine throughout the year but the problem arises with the first month of year change. For eg. if I select Jan 2019 the field as mentioned above does not give me Dec 2018 month to date orders.
My 'Current Month' and 'Current Year' are parameters:
Is there any way I can solve the issue and still continue to use "Current Month' and 'Current Year' parameters?
Attached is the workbook for reference.
Thanks in advance