I used pseudocode to shorten the example. The structure is good.
let
Source1 =
let
Workbook = File.Contents(...),
Final = Table.SelectColumns( ... )
in
Final,
Source2 =
let
Workbook = File.Contents(...),
Final = Table.SelectColumns( ... )
in
Final,
// You can use append or join, or whichever function the UI was using to merge them
FinalMerge = Table.Combine({ Source1, Source2 }, ... )
in
FinalMerge
let
Source1 =
[
Workbook = File.Contents(...),
Return = Table.SelectColumns( ... )
][Return],
Source2 =
[
Workbook = File.Contents(...),
Return = Table.SelectColumns( ... )
][Return],
// You can use append or join, or whichever function the UI was using to merge them
FinalMerge = Table.Combine({ Source1, Source2 }, ... )
in
FinalMerge
If you return the full record, you can drill down into each step. If you need to debug one.
let
Source1 =
[
Workbook = File.Contents(...),
Return = Table.SelectColumns( ... )
],
DrillDown = Source1
in
DrillDown