Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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.

 

  • 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])

5 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    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])
  • Anonymous's avatar
    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

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident 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

  • Anonymous's avatar
    Anonymous
    Not applicable

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

  • Anonymous's avatar
    Anonymous
    Not applicable

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