Forum Discussion

CahabaData's avatar
CahabaData
Icon for Memorable Member rankMemorable Member
9 years ago
Solved

Trailing 12 or Rolling 12 month sum

trying to craft the correct DAX measure; data table/model is transacation per row/record: (snippet of 1 month)   Person - ActualDate - Amount Jim            11/22/16     $1000       Jim          ...
  • parry2k's avatar
    parry2k
    9 years ago

    you don't need to use monthname, that is only for average, but this formula you need to translate

     

    Sales12M := CALCULATE (
        [Sales],
        DATESBETWEEN (
            Calendar[FullDate],
            NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( Calendar[FullDate] ) ) ),
            LASTDATE ( Calendar[FullDate] )
        )
    )

    So sales in this case will be amount and full date will be replaced with date from your calendar table.

     

    You don;t need to worry about person, once you add this on a visual with person, it will automatically group it by person.