Forum Discussion

Anders_G's avatar
Anders_G
Helper I
4 years ago
Solved

Help with M expression - Create custom column based on Date

Hi,

 

I need help writing an M expression for a custom column in Power Query

 

I have a column with dates called "Initial Date". Depending on the quarter in which the date falls I want to create a new custom column "Desired Date" that gives the first day of the next quarter. Quarters are running from Jan-Mar etc. In the example below 2022-01-01 should return 2022-04-01 and 2022-05-03 should return 2022-07-01.

 

 

Thank you!

 

  • Anders_G , Try one of the two in power query as a new column

     


    Date.AddQuarters([Column],1)

     

     

    Date.StartOfQuarter(Date.AddQuarters([Column],1))

2 Replies

  • Anders_G , Try one of the two in power query as a new column

     


    Date.AddQuarters([Column],1)

     

     

    Date.StartOfQuarter(Date.AddQuarters([Column],1))

    • Anders_G's avatar
      Anders_G
      Helper I

      That worked very well. Thank you very much!