PDA

View Full Version : PQ- End of previous month



sandy666
07-10-2023, 08:13 PM
DateNowDateNowEndOfPrevMonth


05/07/2023
05/07/2023
30/06/2023



// Table1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Type = Table.TransformColumnTypes(Source,{{"DateNow", type date}}),
EOPM = Table.AddColumn(Type, "EndOfPrevMonth", each Date.EndOfMonth(Date.AddMonths([DateNow], -1)), type date)
in
EOPM

or


EndOfPreviuosMonth


30/06/2023


// EndOfPreviuosMonth

let
Source = Date.From(Date.EndOfMonth(Date.AddMonths(DateTime. LocalNow(), -1)))
in
Source