Hi
I'm trying to create following columns using DAX from an existing date column on a table.
1. Fiscal_year_numer : Output -> 2021-22
I've created a "year" column with DAX like below:
Year = Year (Reference to the table [specific column consisting dates])
Can anyone suggest how to create a column with a fiscal column output - "2021-22" from a specifc column consisting dates on same table.
Any help would be much appreciated.
thanks
This issue has now been resolved.
Fiscal years more often than not do not align with the usual calendar dates. If you have a functional rule that tells you how to create a fiscal value from the usual date, then you should code it appropriately (but the details are specific and without this knowledge nobody can give you formula). Fiscal calendars of any flavour (created in DAX or Power Query) can easily be found via a Google search. You can even start here -> www.sqlbi.com.
You could use either a Switch statement,
or a mega IF statement?
Fiscal Year =
IF(AND([Year] =2012,[Month]<=12),"FY13",
IF(AND([Year] =2013,[Month]<=6),"FY13",
IF(AND([Year] =2013,[Month]<=12),"FY14",
IF(AND([Year] =2014,[Month]<=6),"FY14",
IF(AND([Year] =2014,[Month]<=12),"FY15",
" ")))))
Please, do not write code like this and do not advocate it. It's hard to read, hard to debug and hard to maintain. Instead, use SWITCH. Thanks.
@daXtreme , I tried to create a column based on your recommendation.