duplicate your query. right click ID column ... unpivot other columns Unpivoting removes null items automatically
right click ID, group by, operation average on value column. File .. close and load ... connection only ... to save that query
Go to your original query. Home .. merge queries ... choose the current query for the top, the other query for the bottom and click on ID column in both of them, use a left outer join. Use arrow atop the new column to expand the average column
You can do it in a single query with some manual code editing in home ...advanced .. as in below example
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"A", Int64.Type}, {"B", Int64.Type}, {"C", Int64.Type}}),
// create average
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ID"}, "Attribute", "Value"),
#"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {"ID"}, {{"Average", each List.Average([Value]), type number}}),
// merge back to original data
#"Merged Queries" = Table.NestedJoin(#"Changed Type",{"ID"},#"Grouped Rows",{"ID"},"GR",JoinKind.LeftOuter),
#"Expanded Table2" = Table.ExpandTableColumn(#"Merged Queries", "GR", {"Average"}, {"Average"})
in #"Expanded Table2"