Explaining why, should probably be left to the MSFT Power Query team…
The error isn’t propagated somehow… Note that there’s also a potential risk of data loss when you select Source2 in the ChType step. Evaluating that, removes all rows below the error.
let
Source1 = Table.FromColumns( {{123, 34, 12, "as", null}}, {"Column1"}),
Source2 = Table.FromColumns( {{123, "as", 34, 12, null}}, {"Column1"}),
Source3 = Table.FromColumns( {{"as", 123, 34, 12, null}}, {"Column1"}),
Source4 = Table.FromColumns( {{123, 34, 12, null, "as"}}, {"Column1"}),
ChType = Table.TransformColumnTypes(Source4,{{"Column1", type number}}),
RemoveBlanks = Table.SelectRows(ChType, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))),
RemoveErrors = Table.RemoveRowsWithErrors(RemoveBlanks, {"Column1"})
in
RemoveErrors
These all work (again, just change the table reference inside the ChType step to test each one of them). The basic process => Remove errors BEFORE removing Blanks.
let
Source1 = Table.FromColumns( {{123, 34, 12, "as", null}}, {"Column1"}),
Source2 = Table.FromColumns( {{123, "as", 34, 12, null}}, {"Column1"}),
Source3 = Table.FromColumns( {{"as", 123, 34, 12, null}}, {"Column1"}),
Source4 = Table.FromColumns( {{123, 34, 12, null, "as"}}, {"Column1"}),
ChType = Table.TransformColumnTypes(Source4,{{"Column1", type number}}),
RemoveErrors = Table.RemoveRowsWithErrors(ChType, {"Column1"}),
RemoveBlanks = Table.SelectRows(RemoveErrors, each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
RemoveBlanks
Or maybe a better approach would be a custom filter and leave the ChType step to the end.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
FilterRows = Table.SelectRows( Source, each [Column1] is number ),
ChType = Table.TransformColumnTypes(FilterRows,{{"Column1", type number}})
in
ChType
.
Interesting…