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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.