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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Day to Date format

Hi,

 

I have day of the year. I need to populate date from the day. I cant find which date function to use. I converted the data type from number to date, but it returns the previous date. with year as 1900. See sample below. Please help!

 

Day of the yearDate in Power BIActual Date
2817th October 19008th October 2018
2828th october 19009th October 2018

 

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

I haven't really tested this but the DATE function deals with numbers in a way that should help you.

'date calc'[day] is your 281, for example.

 

Column = DATE(2018,1,'date calc'[day])

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Apologies for the delayed reply. This solution worked! Thanks!

Anonymous
Not applicable

Apologies for the delayed reply. This solution worked! Thanks!

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

By my tests, the fomula of HotChilli should solve your problem.

 

If you solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Try HotChilli's solution first.

 

Microsoft counts date from 1st January 1900. So the 281st day happened to be the day 7th October 1900.

 

This silly hack may work:

Date = 'Table'[Day of the Year]+43103

HotChilli
Super User
Super User

I haven't really tested this but the DATE function deals with numbers in a way that should help you.

'date calc'[day] is your 281, for example.

 

Column = DATE(2018,1,'date calc'[day])

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.