There's more...

First, to convert this DAX calculation from a column to a measure, simply edit these two lines as follows:

VAR __Year = YEAR(MAX('R02_Calendar'[Date]))    
VAR __date = MAX('R02_Calendar'[Date])

Second, a company may have a really obscure method of assigning quarters, such as the first Monday in October, or the first working day in October. Since this technique only relies upon assigning numeric months and days for quarter starting dates, this recipe can be combined with other recipes in this book, such as those for finding the first working day of a month.