Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
mrp614
New Member

Creating financial year column - How to make this code shorter and efficient?

Following code will work fine but will only cover the period from April 2019 to March 2025, is there a way to automate this code so that it generates FY as required based on the date clolumn? 
 
FY = 
IF(AND([Year]=2019, [Month]>=4), "2020",
IF(AND([Year]=2020, [Month]<=3), "2020",
IF(AND([Year]=2020, [Month]>=4), "2021",
IF(AND([Year]=2021, [Month]<=3), "2021",
IF(AND([Year]=2021, [Month]>=4), "2022",
IF(AND([Year]=2022, [Month]<=3), "2022",
IF(AND([Year]=2022, [Month]>=4), "2023",
IF(AND([Year]=2023, [Month]<=3), "2023",
IF(AND([Year]=2023, [Month]>=4), "2024",
IF(AND([Year]=2024, [Month]<=3), "2024",
IF(AND([Year]=2024, [Month]>=4), "2025",
IF(AND([Year]=2025, [Month]<=3), "2025"))))))))))))
 
Appreciate your help.
Cheers.
1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @mrp614 

This is a bit more compact

 

IF( [Month]>=4), [Year] + 1, [Year] )

View solution in original post

2 REPLIES 2
mrp614
New Member

Thank you, PaulOlding. 

PaulOlding
Solution Sage
Solution Sage

Hi @mrp614 

This is a bit more compact

 

IF( [Month]>=4), [Year] + 1, [Year] )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.