Forum Discussion

fyrworx's avatar
fyrworx
Frequent Visitor
9 years ago
Solved

DATEINPERIOD issues

I am trying to create a rolling 6 week view of a count.    It should be simple - an aggregate of weekly totals for the last 6 weeks of daily data. Put into a line graph.   I am following this gui...
  • v-yulgu-msft's avatar
    v-yulgu-msft
    9 years ago

    Hi fyrworx,

     

    Please modify your DAX formula as:

    3 Month Moving Sum Units Sold =
    CALCULATE (
        SUM ( 'Moving Average'[Compliant] ),
        ALL ( 'Moving Average' ),
        DATESINPERIOD ( Dates[Date], LASTDATE ( Dates[Date] ), -3, DAY )
    )

    Thanks,
    Yuliana Gu