Forum Discussion
CJANE
8 years agoHelper I
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
Add a calendar table and build relationship.
Measure = TOTALMTD ( SUM ( PrimaryTrades[GrossAmountOffer] ), DATEADD ( DATESMTD ( 'Calendar'[Date] ), -1, YEAR ) )
2 Replies
- Ashish_MathurSuper User
Hi,
Try this
=CALCULATE(SUM(PrimaryTrades[GrossAmountOffer]),DATESBETWEEN(PrimaryTrades[TradeDate],EOMONTH(TODAY(),-12)+1,EDATE(TODAY(),-12)))
Hope this helps.
- v-chuncz-msftCommunity Support
Add a calendar table and build relationship.
Measure = TOTALMTD ( SUM ( PrimaryTrades[GrossAmountOffer] ), DATEADD ( DATESMTD ( 'Calendar'[Date] ), -1, YEAR ) )