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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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