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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Yuiitsu
Helper V
Helper V

IF statement for date

Hi Expert

 

I need to create a new column using IF statement to calculate my finance year.

 

E.g: if date falls between April 2019 to March 2020 = FY 20

if date falls between April 2018 to March 2019 = FY 19

 

Can anyone help me with this statement?

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Yuiitsu 

 

Based on your description, I created data to reproduce your scenario.

Table:

 

Table = CALENDAR(DATE(2018,1,1),DATE(2020,12,31))

 

 

You may create a calculated column as below.

 

finance year = 
var _date = 'Table'[Date]
var _month = MONTH(_date)
var _year = YEAR(_date)

return
IF(
    _month>=4&&_month<=12,
    CONCATENATE("FY",VALUE(FORMAT(_date,"YY"))+1),
    IF(
        _month<=3&&_month>=1,
        CONCATENATE("FY",VALUE(FORMAT(_date,"YY"))+0)
    )
)

 

 

Result:

a1.PNG

 

a2.PNG

 

Best Regards

Allan

 

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

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Yuiitsu 

 

Based on your description, I created data to reproduce your scenario.

Table:

 

Table = CALENDAR(DATE(2018,1,1),DATE(2020,12,31))

 

 

You may create a calculated column as below.

 

finance year = 
var _date = 'Table'[Date]
var _month = MONTH(_date)
var _year = YEAR(_date)

return
IF(
    _month>=4&&_month<=12,
    CONCATENATE("FY",VALUE(FORMAT(_date,"YY"))+1),
    IF(
        _month<=3&&_month>=1,
        CONCATENATE("FY",VALUE(FORMAT(_date,"YY"))+0)
    )
)

 

 

Result:

a1.PNG

 

a2.PNG

 

Best Regards

Allan

 

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

Anonymous
Not applicable

Hi @Yuiitsu 

 

Please check the link            Fiscal year Calculated column 

 

 

Cheers

 

CheenuSing

amitchandak
Super User
Super User

 

@Yuiitsu 

Create an end of year and use

 

FY = "FY" & format(endofyear([date],"3/31"),"YY")

 

https://docs.microsoft.com/en-us/dax/endofyear-function-dax

 

You also have startofyear. That also takes the end date as parameter, if needed

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.