Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
i have such an issue - there is sales sum in several months and i need to get previous period sum (in that case previous month) while selected one certain month. I have tried about 5-6 formulas and no one works, for example:
Sum({$<Month={"$(=Max([Дата.autoCalendar.Month])-1)"}>} [Sum] ) - this shows the same sum (selected and previous month), though there is another sum in previous month.
Could anyone help me?
Try this:
Sum({$<[Дата]={"$(='>=' & Date(Monthstart(Max([Дата]),-1), DD.MM.YYYY') & '<' & Date(Monthstart(Max([Дата])), DD.MM.YYYY'))"}, [Дата.autoCalendar.YearMonth]>} [Sum] )
Try this:
Sum({$<[Дата]={"$(='>=' & Date(Monthstart(Max([Дата]),-1), DD.MM.YYYY') & '<' & Date(Monthstart(Max([Дата])), DD.MM.YYYY'))"}, [Дата.autoCalendar.YearMonth]>} [Sum] )
it works! thanks a lot.