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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Create a custom Financial Year Column

Hi, 

 

I need to create a new column to record a financial year which runs from 1st September to 31st August. What I would like to have in as the out put would be, as an example, FY21/22.

 

Any idea how I can look to create this, please? I have data in my calendar table that runs from 1st Jan 2014 to 31st December 2022

 

I have found this which creates the Fiscal Year, but not too sure how I can amend this to show the year period that I need

fiscal year =

var curryear = right(year('date'[date]),2)
var lastyear = right(year('date'[date])-1,2)
var newyear = right(year('date'[date])+1,2)

var fiscalyear =

switch(
true(),
month('date'[date]) >=4,
curryear & "-" & newyear,
lastyear & "-" & curryear

)
return

fiscalyear
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Start date of the financial year = 
IF(MONTH([Date])<9,DATE(Year([Date])-1,9,1),DATE(Year([Date]),9,1))
financial year = YEAR([Start date of the financial year])
FY = 
var curryear = right([financial year],2)
var newyear = right([financial year]+1,2)
return
curryear&"-"&newyear

vzhangti_0-1657244639806.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
walker4545
Frequent Visitor

Hi Anonymous,

 

I'm sure you've solved this problem long ago, but I just wanted to share my DAX solution for this below for those searching for this solution. I'm always surprised that DAX has no inbuilt function for this.

 

Note: this code contains some redundant variables for those that want to customise the Fiscal Year format.

 

Also, for those wanting a Fiscal Year/Financial Year beginning in July, change the LogicalTest of the IF statement in the return section to MonthNo <= 6. Always use the string variables since you're concatenating text in the RETURN statement. See bottom of post for code without comments that evaluates new FY as starting in July.

 
Fiscal Year = 
//Get year of date as integer and assign to variable YearYYYYInt
VAR YearYYYYInt = 'Date Table'[Date].[Year]
//Convert year integer to string for use in RETURN statement string
VAR YearYYYYStr = CONVERT ( YearYYYYInt, STRING )
//Shorten year to two characters using RIGHT function (returns string by default)
VAR YearYY = RIGHT ( YearYYYYStr, 2 )
//Get previous year as integer
VAR PrevYYYYInt = YearYYYYInt - 1
//Get previous year as string
VAR PrevYYYYStr = CONVERT ( PrevYYYYInt, STRING )
//Shorten previous year to two characters
VAR PrevYY = RIGHT ( PrevYYYYStr, 2 )
//Get following year as integer
VAR NextYYYYInt = YearYYYYInt + 1
//Get following year as string
VAR NextYYYYStr = CONVERT ( NextYYYYInt, STRING )
//Shorten following year to two characters
VAR NextYY = RIGHT ( NextYYYYStr, 2 )
//Get month number
VAR MonthNo = MONTH ( 'Date Table'[Date].[Date] )
//If month number equal to or less than 8 (August). Change to 6 for FY beginning in July
//If true, return FY coming to an end that year
//If not true, return FY starting that year
RETURN IF(MonthNo <= 8, "FY" & PrevYY & "/" & YearYY, "FY" & YearYY & "/" & NextYY)
walker4545_0-1722556470051.png
Financial Year = 
VAR YearYYYYInt = 'Date Table'[Date].[Year]
VAR YearYYYYStr = CONVERT ( YearYYYYInt, STRING )
VAR YearYY = RIGHT ( YearYYYYStr, 2 )
VAR PrevYYYYInt = YearYYYYInt - 1
VAR PrevYYYYStr = CONVERT ( PrevYYYYInt, STRING )
VAR PrevYY = RIGHT ( PrevYYYYStr, 2 )
VAR NextYYYYInt = YearYYYYInt + 1
VAR NextYYYYStr = CONVERT ( NextYYYYInt, STRING )
VAR NextYY = RIGHT ( NextYYYYStr, 2 )
VAR MonthNo = MONTH ( 'Date Table'[Date].[Date] )
RETURN IF(MonthNo <= 6, "FY" & PrevYY & "/" & YearYY, "FY" & YearYY & "/" & NextYY)
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Start date of the financial year = 
IF(MONTH([Date])<9,DATE(Year([Date])-1,9,1),DATE(Year([Date]),9,1))
financial year = YEAR([Start date of the financial year])
FY = 
var curryear = right([financial year],2)
var newyear = right([financial year]+1,2)
return
curryear&"-"&newyear

vzhangti_0-1657244639806.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for these formulas. I needed to calculate academic year, which is similar, but starts on July 1. This is the formula I came up with (with your help). Is it right?

 

Academic Year =
var spring = IF(MONTH([Grad Date])<7,Year([Grad Date]),YEAR([Grad Date])+1)
var fall = IF(MONTH([Grad Date])<7,YEAR([Grad Date])-1,YEAR([Grad Date]))
return fall&"-"&spring
 
It seems like the same thing, but I don't need to calculate the first day of the year to get to this. Skip the middleman!
amitchandak
Super User
Super User

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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