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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
noyesae
Regular Visitor

2020 / 2019 Julian Date Issues

I'm having an issue converting Julian Dates of 2020 and 2019.  I am currently using the below for a new column and it is working for Julian dates that start with 0 but for ones that start with 9 it's returning 2029 and I'm needing it to return 2019, how can I make this happen?  My dates are 4 digits, 9347, 0146, 0003, etc

 

Load Date = VAR myYear = 2020 + INT(DIVIDE([Julian Date],1000))
VAR myDayOfYear = MOD([Julian Date],1000) -1
RETURN DATE( myYear,1,1) + myDayOfYear
1 ACCEPTED SOLUTION

The myYear variable is never going to return anything less than 2020.

If the year is either 2019 or 2020, then in the absence of anything more elegant:

VAR myYear = IF (INT(DIVIDE(TableJul[Column1],1000)) = 9, 2019, 2020)

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

As far as I understand Julian dates are contiguous. Where does the 1000 come into play here?  Shouldn't you be using all digits of the Julian dates?

I'm new to Power BI and I stole that formula doing a google search so I'm not sure where the 1000 is coming from or what it is doing.  I'm open to any suggestions on changes.

The myYear variable is never going to return anything less than 2020.

If the year is either 2019 or 2020, then in the absence of anything more elegant:

VAR myYear = IF (INT(DIVIDE(TableJul[Column1],1000)) = 9, 2019, 2020)

@HotChilli That just gets me the year, I need to turn 9001 to Jan 1, 2019 or 0001 to Jan 1 2020.

That's right.  You can do the substituting into your original formula.

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!

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.