Forum Discussion
PARALLELPERIOD vs DATEADD
- 8 years ago
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.
- 8 years ago
What should happen is that the PARALLELPERIOD function would return all dates from the next month (July 1 to July 31) but DATEADD should only July 1 to July 21.
I'll try to explain it better.
What I need is to have the sales number from Feb. 1 to Feb. 26 to show on the multiply card in conjunction with the indicator that shows sales for the current month (March 1 to March 26).
One indicator is sales of the month and the other sales in the same period of the previous month (MPMA Sales)
In the table I put the dates of sales and the three measures that I used to try to reach these numbers.
The measures that use PARALLELPERIOD AND DATEADD, -1, MONTH show the sales of the whole February month, but I only want the sales until the same day of today only that in the previous month, in the case would be until February 26.
The other measure used DATEADD, -30, DAY totals sales considering 30 days before the 26th of February and then considers and adds sales from the end of January, which does not interest me in the context I want to compare
Finally, the three measures mentioned above are inserted in the multiple card, showing the same results of the totals in the table, but none of them are showing the result that I need, which are sales for the same period of the previous month.
Updating to today's date (March 28th) I would have sales from March 1 to March 27 in a gauge and sales from Feb. 1 to Feb. 27 on one of the indicators that are detailed in the table.
Hi,
What should the result be when the date is March 31? What dates should the formula consider for the previous month?
- Anonymous7 years agoNot applicable
Hello
I would always like to see the result considering the current date, that is, today is March 29, so I have sales closed until March 29, and I would like to also have sales until February 29 to compare them and know how we are in relation to the same period of the previous month.
When the date is March 31 I would have to compare it with the value of February 28, current month compared with the previous month. - Ashish_Mathur7 years agoSuper User
Hi,
Try this measure
=CALCULATE(SUM(Data[Amount]),DATESBETWEEN(Calendar[Date],EOMONTH(MIN(Calendar[Date]),-2)+1,EDATE(MIN(Calendar[Date]),-1)))
I have assumed that you will select a particular date in a slicer/filter such as March 30, 2019.
Hope this helps.