Forum Discussion
MTD questions
Use PARALLELPERIOD with month as the interval and -1.
You would use DATESMTD function as your dates input
Thanks for the reply and here is what I noticed in parallelperiod help, based on this, seems like, I cannot use it for MTD.
The PARALLELPERIOD function is similar to the DATEADD function except that PARALLELPERIOD always returns full periods at the given granularity level instead of the partial periods that DATEADD returns. For example, if you have a selection of dates that starts at June 10 and finishes at June 21 of the same year, and you want to shift that selection forward by one month then the PARALLELPERIOD function will return all dates from the next month (July 1 to July 31); however, if DATEADD is used instead, then the result will include only dates from July 10 to July 21.
- Greg_Deckler10 years ago
Community Champion
Use DATEADD then:
https://support.office.com/en-US/article/DATEADD-Function-DAX-035e775e-6ef8-416e-816f-ebeeb826ba22
- parry2k10 years ago
Super User
Well assumption here is use in built function MTD/QTD/YTD, if I have to use dateadd function, not sure what is the purpose of MTD/QTD/YTD functions.
I'm sure this is nothing to do with my dataset and must be a way to resolve simple MTD.
- Greg_Deckler10 years ago
Community Champion
From your previous examples, DATESMTD is working fine but you are trying to do something strange, which is DATESMTD but for the previous month, which is effectively a PARALLELPERIOD for potentially half a month or 20 days of the previous month or whatever. So, with DATEADD, you would be feeding it DATESMTD and then rewinding 30 days or whatever. That seems to be what you want to do in your latest posts and what you are trying to do unless I am severely misunderstanding something.
So, let's say it is the 11th of December, DATESMTD will give you 12/1/2015-12/11/2015 and then DATEADD with an interval of a month and -1 should give you 11/1/2015-11/11/2015.
Versus PARALLELPERIOD, which would give you 11/1/2015-11/30/2015.
Ultimately, I'm pretty confused here as you seem to want it both ways, in some of your posts, you want it to be one way and in some of your posts, you seem to want it to be the other way. The way that you seem to want from your original post would be to use PARALLELPERIOD, where it would give you the full date range for the previous month. That is what you seem to want from your original post, right?
Confused...