Hello @doudouh ,
Here is my table per specifications:
... And here is what I did:
Create a new Calculated item.
Let's use new aggregate operator called Relative Period and define it to calculate simple sum of current month (0), previous month (-1), and a month before that (-2). Here is the code snippet that you can copy to Text Editor:
(
IF ( RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, 0, _Full_,
{Date}) NotMissing )
RETURN RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, 0, _Full_,
{Date})
ELSE 0 ) +
(IF ( RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, -1, _Full_,
{Date}) NotMissing )
RETURN RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, -1, _Full_,
{Date})
ELSE 0 ) +
(IF ( RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, -2, _Full_,
{Date}) NotMissing )
RETURN RelativePeriod(_Sum_, 'number'n,
_IgnoreAllTimeFrameFilters_, 'Date'n, _Inferred_, -2, _Full_,
{Date})
ELSE 0 )
Let me know if you need more detailed helped.
Best regards, Petri Roine
... View more