Forum Discussion

mbegg's avatar
mbegg
Advocate II
9 years ago
Solved

Card with trailing 12 month average

Hi,    I have monthly sales data and a date table. I have calculated trailing 12 month (TTM) average sales.    I want to display TTM for most recent month on a card on a report.    If I add a f...
  • mbegg's avatar
    mbegg
    9 years ago

    GilbertQ thanks for the suggestion. 

     

    I found the following worked:

    • Create a column in the date table with 1s & 0s to flag last 12 months.
    • Create the below measure

     

    Sales_ttm avg. = 
    AVERAGEX( KEEPFILTERS(VALUES('Date'[Date].[Date])), CALCULATE(SUM('Sales'[Value]),'Date'[FLAG_TTM]=1)
    )