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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.