SQL Server Central explains How to Handle Calculations Related to fiscal year and quarter with a little different method, subtracting from a base date rather than using a calendar table.
How to Handle Calculations Related to fiscal year and quarter – SQLServerCentral
Archived post from 2014. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.