Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Month to Date Measure

Trying to create a measure that sums sales from Calendar month to date.

I have so far this expression:

(sum(aggr(sum(distinct{$<[completed_date.autoCalendar.Date]={">=$(=Date(max([completed_date])-30))"}>}(order_total)), order_id))

but if I am not mistaking, the value I am getting is sales from last thirty days, not "Calendar" month.  Any help to transform this expression to one that will show Month to date value?  Any help is appreciated.  Thank you!

2 Replies
Lisa_P
Employee
Employee

Hi Ism,

I can see you are using the autoCalendar features.  I think the two that you want to use are the InMTD flag and the MonthsAgo field in your set analysis.

[completed_date.autoCalendar.InMTD]={1}   is for dates up to today's date in all months

[completed_date.autoCalendar.MonthAgo]={0} is for current month, so the two together will limit to this month


Lisa

Anonymous
Not applicable
Author

Don't think I have those fields.  Any other idea on how to do this?