Code:

(LoanAmount as number, Rate as number, Periods as number)=>
let
PeriodicInterestRate = Number.Power( Number.Power( (1+(Rate/2)), 2), (1/12)) - 1,
Payment = Number.Round( (LoanAmount * PeriodicInterestRate) / ( (1 - Number.Power( (1 + PeriodicInterestRate), -Periods) )), 2),
LoanList = List.Accumulate(List.Buffer(
{2..Periods}),
{[Period = 1,
BegBal= LoanAmount ,
MonthlyPayment = Payment,
Interest = Number.Round(BegBal*PeriodicInterestRate, 2),
Principal = Payment - Interest,
EndBal = BegBal - Principal]},
(s,c) =>
{[Period = c,
BegBal= List.First(s)[EndBal],
MonthlyPayment = Payment,
Interest = Number.Round(BegBal*PeriodicInterestRate ,2),
Principal = Payment - Interest,
EndBal = BegBal - Principal
]}
& s),
LoanTable = Table.FromRecords(LoanList),
LoanTableRename = Table.RenameColumns(LoanTable ,{{"Period", "Payment Number"}, {"BegBal", "Opening Balance"}, {"Interest", "Monthly Interest"}, {"MonthlyPayment", "Monthly Payment"}, {"Principal", "Monthly Principal"}, {"EndBal", "Balance Remaining"}}),
LoanTableSort = Table.Sort(LoanTableRename ,{{"Payment Number", Order.Ascending}}),
LoanTableFinal = #table( {"Payment Number", "Balance Remaining"}, { {0,LoanAmount} }) & LoanTableSort
in
LoanTableFinal

Best regards,
## Bookmarks