Forum Discussion

CJANE's avatar
CJANE
Helper I
8 years ago
Solved

Current and Previous MTD Calculation

Hello:

 

Any recommendations from the community on how I can update the expression below so prior year MTD only includes 10/01/2016 through 10/16/2016.  Currently the measure is returning the sum for 10/01/2016 through 10/31/2016.  I want to compare current and previous MTD for the same date period.

 

PMYTD = TOTALMTD(SUM(PrimaryTrades[GrossAmountOffer]),DATEADD(DATESMTD(PrimaryTrades[TradeDate]),-1,MONTH))

 

Thanks

  • CJANE,

     

    Add a calendar table and build relationship.

    Measure =
    TOTALMTD (
        SUM ( PrimaryTrades[GrossAmountOffer] ),
        DATEADD ( DATESMTD ( 'Calendar'[Date] ), -1, YEAR )
    )
    

2 Replies

  • Hi,

     

    Try this

     

    =CALCULATE(SUM(PrimaryTrades[GrossAmountOffer]),DATESBETWEEN(PrimaryTrades[TradeDate],EOMONTH(TODAY(),-12)+1,EDATE(TODAY(),-12)))

     

    Hope this helps.

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    CJANE,

     

    Add a calendar table and build relationship.

    Measure =
    TOTALMTD (
        SUM ( PrimaryTrades[GrossAmountOffer] ),
        DATEADD ( DATESMTD ( 'Calendar'[Date] ), -1, YEAR )
    )