Forum Discussion

powertechbi's avatar
powertechbi
Frequent Visitor
1 year ago
Solved

Help with fixed Date

Good afternoon

I have the following question: I have a column with the check-out dates of hotel guests and I need to create a new column that always brings me the 15th of the month following the check-out date.

Examples: 08/10/24 - return 09/15/2024

10/23/2024 - return 11/15/2024


Would anyone know how to do it?

 

 

  • Calculated column:

    NextMonth15th = 
    DATE(YEAR([CheckOutDate]), MONTH([CheckOutDate]) + 1, 15)

     

    Power Query

    = Date.From(Date.AddMonths([CheckOutDate], 1)) + (15 - Date.Day(Date.From(Date.AddMonths([CheckOutDate], 1))))

3 Replies

  • Kaviraj11's avatar
    Kaviraj11
    Solution Sage

    Calculated column:

    NextMonth15th = 
    DATE(YEAR([CheckOutDate]), MONTH([CheckOutDate]) + 1, 15)

     

    Power Query

    = Date.From(Date.AddMonths([CheckOutDate], 1)) + (15 - Date.Day(Date.From(Date.AddMonths([CheckOutDate], 1))))
  • OktayPamuk80's avatar
    OktayPamuk80
    Responsive Resident

    Hi,

    Try:

    Following Date = DATEADD(STARTOFMONTH( NEXTMONTH('Table'[Date])),14,DAY)

     

    Better Option to create the required field in the Power Query (if you run into performance issues).

    Regards,

    Oktay

     

    If it helps, appreciate for Kudos and mark as solution 🙏🏻!!!