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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hannahs5
New Member

Creating Fiscal Year Text column in date table

I'm trying to find a way to connect my date table to a table that includes students' grade reports. The student grade report does not have a true date column. There are two columns that contain text that indicate the school year and term that the grades were earned, like below:

School YrTerm
202122Fall
202223Winter
201920Spring
201819Winter

 

My thought is that I should create a column in my date table that identifies all dates from July 1, 2018-June 30, 2019 as the text 201819 (and all dates from July 1, 2019-June 30, 2020 as 201920 etc) so that I can relate it to the School Year column of the grade reports.

 

Assuming it's possible, how can I use DAX to create this column?

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @hannahs5 

in your date table, try to add a column with this
AcadYear =
VAR _year = YEAR([Date])
VAR _month = MONTH([Date])
RETURN
IF(
    _month>=7,
    _year&RIGHT(_year+1, 2),
    (_year-1)&RIGHT(_year, 2)
)

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @hannahs5 

in your date table, try to add a column with this
AcadYear =
VAR _year = YEAR([Date])
VAR _month = MONTH([Date])
RETURN
IF(
    _month>=7,
    _year&RIGHT(_year+1, 2),
    (_year-1)&RIGHT(_year, 2)
)

checked and it worked like this:

FreemanZ_0-1671239318977.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.