Forum Discussion
Create a custom Financial Year Column
- 4 years ago
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&"-"&newyearIs 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.
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)
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)