Forum Discussion
MTD questions
Somehow my reply disappeared, seems like previous month is for full month not MTD. So in that case, do i have to have two measures, one for previousmonth and one for MTD
As per the description in previousmonth function, it will return all dates for the month and in that case MTD will not work.
Here is the what is says on this link https://support.office.com/en-US/article/PREVIOUSMONTH-Function-DAX-72fb8dda-6cd6-49e6-b9b4-8a5f632439c2
This function returns all dates from the previous month, using the first date in the column used as input. For example, if the first date in the dates argument refers to June 10, 2009, this function returns all dates for the month of May, 2009.
- Greg_Deckler10 years ago
Community Champion
Use PARALLELPERIOD with month as the interval and -1.
You would use DATESMTD function as your dates input
- parry2k10 years ago
Super User
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