Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All
I have created a simple code to say if the month is september or earlier and the date is 14th or earlier then show Year -1 and if greater than show year. BUT the year shows correctly for dates before but doesn't seem to work for dates after. Where am I going wrong?
Solved! Go to Solution.
I'm not too sure of the logic here. What you are saying is that 13/september/2022 is FY 2021, but the 20/august/2022 is FY 2022?
If so , try:
FY =
IF (
AND ( MONTH ( fTable[Date] ) < 10, DAY ( fTable[Date] ) < 15 ),
YEAR ( fTable[Date] ) - 1 & " FY",
YEAR ( fTable[Date] ) & " FY"
)
If the cut-off date is the 14 september (so dates before are the previous year and dates after are the current year, then try:
FY 14 sep =
VAR _Date = DATE(YEAR('Date'[Date]), 9, 15)
RETURN
IF (
'Date'[Date] < _Date,
YEAR ( 'Date'[Date] ) - 1 & " FY",
YEAR ( 'Date'[Date] ) & " FY"
)
Proud to be a Super User!
Paul on Linkedin.
I'm not too sure of the logic here. What you are saying is that 13/september/2022 is FY 2021, but the 20/august/2022 is FY 2022?
If so , try:
FY =
IF (
AND ( MONTH ( fTable[Date] ) < 10, DAY ( fTable[Date] ) < 15 ),
YEAR ( fTable[Date] ) - 1 & " FY",
YEAR ( fTable[Date] ) & " FY"
)
If the cut-off date is the 14 september (so dates before are the previous year and dates after are the current year, then try:
FY 14 sep =
VAR _Date = DATE(YEAR('Date'[Date]), 9, 15)
RETURN
IF (
'Date'[Date] < _Date,
YEAR ( 'Date'[Date] ) - 1 & " FY",
YEAR ( 'Date'[Date] ) & " FY"
)
Proud to be a Super User!
Paul on Linkedin.
Great thanks. The odd start dates correlates to the agricultural year in the UK.
How do I display the year as just the two last numbers?
Use the RIGHT functio:
FY Short =
IF (
AND ( MONTH ( 'Date'[Date] ) < 10, DAY ( 'Date'[Date] ) < 15 ),
RIGHT(YEAR ( 'Date'[Date] ) - 1, 2) & " FY",
RIGHT(YEAR ( 'Date'[Date] ), 2) & " FY"
)
Proud to be a Super User!
Paul on Linkedin.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.