Forum Discussion

dshah12's avatar
dshah12
Icon for Helper II rankHelper II
3 years ago

Fiscal Year from Date

I am getting data using the direct query and wanted to create a fiscal year range from date but it does not work from below DAX it gives 
2022-2023.0 and similar redundant 

Fiscal Year =
VAR CurrentYear = YEAR(cmhc_drawscheduleitem[cmhc_date])
VAR fsNextYear = CurrentYear + 1
VAR fsPreviousYear = CurrentYear - 1

RETURN
IF(
    MONTH(cmhc_drawscheduleitem[cmhc_date]) >= 4,
    CONCATENATE(CurrentYear, CONCATENATE("-", fsNextYear)),
    CONCATENATE(fsPreviousYear, CONCATENATE("-", CurrentYear))
)

1 Reply

  • This should work, but can be refactored

    Fiscal Year =
    VAR CurrentYear = YEAR(cmhc_drawscheduleitem[cmhc_date])
    RETURN
    IF(
        MONTH(cmhc_drawscheduleitem[cmhc_date]) >= 4,
        CurrentYear & "-" & (CurrentYear+1),
        (CurrentYear-1) & "-" & CurrentYear
    )