I am looking for a way to set the Fiscal Year to be dynamic so I won't change it every Fiscal Year Start.
I already have all dates I need in my calendar table as you can see in the picture. Fiscal Year Start Date & Fiscal Year End Date (for all the years)
I can't use ... WHERE FiscalYear = Year(GetDate())
as Jan of all years almost belongs to the previous calendar year ex: 01/01/2024 is still Fiscal Year 2023
I also can't use a case when expression as the start and end of each Fiscal Year is different.
How can I possibly get the dynamic Fiscal Year in my case?
1条答案
按热度按时间z18hc3ub1#
Using your example data:
You can get the current Fiscal Year value as follows:
Currently this gives the result
2023
, but once it's 4th Feb 2024 or later (and on or before 1st Feb 2025), it will return2024
.