Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
how to show Last month sales i am getting syntax problum please help me
Current Month
=num(sum({<[Month Year]= {"$(=Date(Max(Date#([Month Year], 'MMM YYYY')),'MMM YYYY'))"} >}Sales))
Last Month
=num(sum({<[Month Year]= {"$(=Date(Max(AddMonths(Date#([Month Year], 'MMM YYYY'),-1)),'MMM YYYY'))"} >}Sales))
Your Month Year field is text field and not Dual (Date) Field. Make these changes in the script and rerun:
LOAD MonthName(Date#([Month&Year], 'MMM YYYY')) as MonthYear,
Sales
FROM
[USA.xlsx]
(ooxml, embedded labels, table is Sheet1);
Once you have done that, try this expression:
=Sum({<MonthYear= {"$(=MonthName(AddMonths(Max(MonthYear), -1)))"}>} Sales)
Current Month
=num(sum({<[Month Year]= {"$(=Date(Max(Date#([Month Year], 'MMM YYYY')),'MMM YYYY'))"} >}Sales))
Last Month
=num(sum({<[Month Year]= {"$(=Date(Max(AddMonths(Date#([Month Year], 'MMM YYYY'),-1)),'MMM YYYY'))"} >}Sales))
Count({$ <[Month Year]={"$(=(Date(Max(AddMonths(Date#([Month Year], 'MMM YYYY'),-1)), 'MMM YYYY')))"}>} [Month Year])