Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

MTD Running Total Sales

Hi all,   I have already posted regarding this problem and never really found a solution so I am going to rephrase hoping someone out there can help.   I am trying to build measures allowing to g...
  • popov's avatar
    popov
    8 years ago

    Correct formula

     

    Prev MTD Running Total Sales =
    VAR CurrentDayNumber =
        MIN ( MAX ( YTDInfos[CurrentDayNumber] ); MAX ( 'Calendar'[DayNumber] ) )
    RETURN
        IF (
            [Prev MTD Sales] <> BLANK ();
            CALCULATE (
                [Total Sales];
                FILTER (
                    ALL ( 'Calendar' );
                    AND ( 'Calendar'[MonthOffset] = -12; 'Calendar'[DayNumber] <= CurrentDayNumber )
                )
            )
        )