let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Split1 = Table.SplitColumn(Source, "Item", Splitter.SplitTextByDelimiter(" - ", QuoteStyle.Csv), {"Company", "AccountName"}),
Split2 = Table.SplitColumn(Split1, "AccountName", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"AccountName", "AccountNumber"}),
Split3 = Table.SplitColumn(Split2, "Time", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Year", "Month"}),
tblType = Table.TransformColumnTypes(Split3,{{"Year", Int64.Type}, {"Month", Int64.Type}, {"Value", type number}}),
tbl = Table.AddColumn(tblType, "YTD", (x)=> List.Sum(Table.SelectRows(tblType, each _[Company] = x[Company] and _[AccountNumber] = x[AccountNumber] and
_[Year]=x[Year] and _[Month]<=x[Month])[Value])),
tbl1 = Table.AddColumn(tbl, "LTM", (x)=> List.Sum(Table.SelectRows(tbl, each _[Company] = x[Company] and _[AccountNumber] = x[AccountNumber] and
#date(_[Year],_[Month],1) <=#date(x[Year],x[Month],1) and #date(_[Year]+1,_[Month],1)> #date(x[Year],x[Month],1))[Value]))
in
tbl1