Forum Discussion

Anders_G's avatar
Anders_G
Helper I
4 years ago
Solved

Create a custom column with a date based on another columns date

How do I write a formula that creates a new column that takes a range of dates and delivers a new date?

 

The dates on the left are the ones that I have. I want to create a custom column with the starting date of the next quarter, based on the "Initial date" column. So whichever quarter the "Initial date" falls within the custom column will provide the first day of the next quarter. Q1 = Jan-Mar, etc.

 

The custom column needs to be visible in Power Query.

 

 

Thank you

 

  • Anders_G , Try in power query like

     


    Date.AddQuarters([Column],1)

     

    or

     

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

     

    If this works, Mark as a solution

4 Replies

    • Anders_G's avatar
      Anders_G
      Helper I

      Ran in to a problem. I wasn't aware of at the time of writing my initial question. But I need the custom column created to be visible in Power Query. Unfortunately this calculated DAX column is not visible.

      • amitchandak's avatar
        amitchandak
        Super User

        Anders_G , Try in power query like

         


        Date.AddQuarters([Column],1)

         

        or

         

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

         

        If this works, Mark as a solution