cancel
Showing results for 
Search instead for 
Did you mean: 

Date of Year

Super User
577 Views
Highlighted
Super User
Super User

Date of Year

Sure, you can figure out the day of the year by using a simple formula like:

 

 

DayOfYear = DATEDIFF(DATE(YEAR([Date]),1,1),[Date],DAY) + 1

 

But, how do you take a day of year and convert it to the date of the year?

 

DateOfYear = 
VAR __Year = INT(MAX(Years[Year]))
VAR __DayOfYear = INT(MAX(DaysOfYear[DayOfYear]))
VAR __tmpTable = ADDCOLUMNS(GENERATESERIES(DATE(__Year,1,1),DATE(__Year,12,31),1),"__DayOfYear",DATEDIFF(DATE(__Year,1,1),[Value],DAY)+1)
VAR __DateofYear = MAXX(FILTER(__tmpTable,[__DayOfYear]=__DayOfYear),[Value])
RETURN IF(ISBLANK(__DateofYear),BLANK(),FORMAT(__DateofYear,"mm/dd/yyyy"))

That's how.

 

 

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!