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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rbowen
Helper III
Helper III

Using Greater Than And Less Than With IF Statment

I'm trying to create a calculated column in my Date table for fiscal year based on the CalendarDate column. Here's what I'm after:

 

If the calendar date is greater than or equal 09/01/2022 and less than or equal to 08/31/2023, the result should be 2023. Otherwise, the result should be 2024.  My date table only has dates that encompass both fiscal years 09/01/2022 to 08/31/2024 so anything that isn't 2023 should automatically be 2024. The DAX I'm using is this:

 

FiscalYear = IF('Dates'[CalendarDate] >= 09/01/2022 && 'Dates'[CalendarDate] <= 08/31/2023, "2023", "2024")
 
However, it gives a value of 2024 for every date in the date table instead of the appropriate breakout. I've tried various permutations of this dax statment but either errors or complete blanks. I'm obviously missing some crucial bit of syntax but at a loss to figure out what's going on. What am I missing?

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@rbowen Try:

FiscalYear = IF('Dates'[CalendarDate] >= DATE(2022,9,1) && 'Dates'[CalendarDate] <= DATE(2023,8,31), "2023", "2024")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@rbowen Try:

FiscalYear = IF('Dates'[CalendarDate] >= DATE(2022,9,1) && 'Dates'[CalendarDate] <= DATE(2023,8,31), "2023", "2024")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That worked, thank you Greg!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors