Forum Discussion

Gdibbs's avatar
Gdibbs
Icon for Helper I rankHelper I
4 years ago
Solved

Create a date from distinct day, month & year columns

Hello,

 

I am a PBI user in training.  Here's my problem.  I have three columns of which one is Day, one is Month and one is Year.  All three of these columns are whole numbers.  I want to use these three columns to create a the date (day, month, & year) in one column.  I would like this to be done on the database side in Power Query.  

 

I have read in some other threads as to how this is done, but I cannot get it to work.  So, I am either missing something, or I am attempting something which is not possible (I doubt its this) or the approach requires other steps I am missing.

 

Any help / support would be greatly appreciated.

 

Here are the three columns:

 

 

4 Replies

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

    NewStep=Table.AddColumn(PreviousStepName,"Date",each #date([YEAR],[MONTH],[DAY]))

    • Gdibbs's avatar
      Gdibbs
      Icon for Helper I rankHelper I

      wdx223_Daniel Thank you.  This worked.  I believe I tried this before which did not work, but with one missing character you used.  I did not use "#" before date.  Why is "#" being used before date?  If you don't mind providing a simple explanation it would be greatly appreciated.  Just for my education and background - and for others who may benefit.