5 Replies Latest reply: Mar 1, 2017 2:55 AM by Shraddha Gajare

# Previous Month expresion

Hello,

I have used and following expression to sum the values for current month which works fine:

SUM({\$<[Date]={'>=\$(=MonthStart(Today()))<=\$(=MonthEnd(Today()))'}>}[Sales Actual])

I need to find separately values for previous month trying below expression, but it doesn't work:

SUM({\$<[Date]={'>=\$(=MonthStart(Today()),-1))<=\$(=MonthEnd(Today()),-1))'}>}[Sales Actual])

rgds

Jacek

• ###### Re: Previous Month expresion

Hi

Suppress the comma before -1 lire this :

SUM({\$<[Date]={'>=\$(=MonthStart(Today())-1))<=\$(=MonthEnd(Today())-1))'}>}[Sales Actual])

• ###### Re: Previous Month expresion

extra ) in there after today(), the ,-1 is part of the monthstart arguments

SUM({\$<[Date]={'>=\$(=MonthStart(Today(),-1))<=\$(=MonthEnd(Today(),-1))'}>}[Sales Actual])

• ###### Re: Previous Month expresion

Use Master Calendar and it's Flags to save the pain for using complex Set analysis in front end.

Flags are fairly easy to use.

Master Calendar Script

Sum({< LastMonthFlag = {1}>}[Sales Actual])

• ###### Re: Previous Month expresion

Try:

SUM({\$<[Date]={'>=\$(=MonthStart(Today(),-1))<=\$(=MonthEnd(Today(),-1))'}>}[Sales Actual])

• ###### Re: Previous Month expresion

You can also try