The QUARTER function returns the quarter of a date as an integer in the range 1-4.
QUARTER(
date
)
- date: Value corresponding to a date in datetime format, or text representing a date.
The QUARTER function returns an integer in the range 1-4.
In this first example we apply the function to obtain the quarter to which the date of March 31, 2020 belongs, for which we create the following measure:
Trimestre = QUARTER("31/3/2020")
We see that it returns the value 1 corresponding to the first quarter of the year.
In this second example, we start from a sales table that includes the Order Date field containing purchase dates, and we create a calculated column that extracts the quarter of each date:
Quarter = QUARTER(Sales[Order Date])
If we take the original date and the created field to a table, the result is the following: