Forum Discussion

ivath0's avatar
ivath0
Frequent Visitor
5 years ago
Solved

Custom Column: End Of Last Month

I want to use Power Query to calculate the number of days between the dates in a Dates column(A) and the end date of last month(B). Eg. Between: (A) 22/6/2020 and (B) 31/01/2021
  • AlexisOlson's avatar
    5 years ago

    You could take the difference between the start of the current month and column A and subtract a day.

     

    Duration.Days(DateTime.Date(Date.StartOfMonth(DateTime.LocalNow())) - [A]) - 1