
Hi
Your expected result is really unclear to me. I put the following Table in Excel and entered your formula in column D below:
If this is really what you expect with your Power Query step you can do it as follow (not ideal) assuming your previous step is #"Added Index":
= Table.AddColumn(#"Added Index", "New Column", each
if [Index] = List.Max(#"Added Index"[Index]) then [Column]
else if [Column] = #"Added Index"{[Index]+1}[Column] then [Column] & "y"
else [Column]
)
Also look at Fast and easy way to reference previous or next rows in Power Query or Power BI for alternative