Returns a table that contains a column of all dates from the previous quarter, based on the first date in the dates column, in the current context.
It’s comes under Time Intelligence DAX function category.
Dates – A column with dates.
This function returns all dates from the previous quarter, using the first date in the input column.
For example, if the first date in the dates argument refers to June 10, 2020, this function returns all dates for the quarter January to March, 2020.
So, Let’s start with an example, download the sample Dataset from below link
Step-1: Create a calendar table to using existing dataset “Order Date” column.
Go to Modeling Tab > Click to table icon & write below DAX
Calendar = CALENDAR(MIN('Global-Superstore'[Order Date]), MAX('Global-Superstore'[Order Date]))
Step-2: After that create a relationship between both tables.
Step-3: Now, create a measure to get Previous Quarter Sale.
PREVIOUSQUARTER = CALCULATE(SUM('Global-Superstore'[Sales]), PREVIOUSQUARTER('Calendar'[Date]))
Step-4: Drag Year & Quarter columns from Calendar table & Sales from Global-Superstore.
So, you can see here it returns the result as per definition.
Now, Drag Year, Quarter & date column from calendar table:
As you see in above screen shot, it will return total sum of previous quarter sales against current quarter each dates, here previous quarter was 2011-Q1 and current quarter is 2011-Q2.
Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.