Forum Discussion

tmears's avatar
tmears
Helper III
6 years ago
Solved

MAT

Hi all I want to calcuate the last 12 month Moving Annual totals, which i am using the following which is working.  What i am struggling with is a measure or comparrision against the same period las...
  • jdbuchanan71's avatar
    jdbuchanan71
    6 years ago

    For that one you can put in the IF ( ISBLANK () from your original:

    Mat Volumn 12 = 
    VAR _DateEnd =
        LASTDATE ( VRS[VRS Date] )
    RETURN
    IF ( ISBLANK ( [Net Sales] ), BLANK(),
        CALCULATE (
            [Net Sales],
            ALL ( VRS ),
            DATESINPERIOD ( VRS[VRS Date], _DateEnd, -12, MONTH )
        )
    )