// Query1
let
Tbl1 = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Tbl2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
Base = Table.ExpandTableColumn(Table.NestedJoin(Tbl2,{"Date"},Tbl1,{"Date"},"Tbl1",JoinKind.FullOuter), "Tbl1", {"Date", "Part", "Price"}, {"Date.1", "Part", "Price"}),
Conditions = Table.AddColumn(Base, "Custom", each if [Date] = null then [Date.1] else [Date]),
FillU = Table.FillUp(Table.SelectColumns(Table.Sort(Conditions,{{"Custom", Order.Ascending}}),{"Custom", "Part", "Price"}),{"Part", "Price"}),
FillD = Table.FillDown(Table.SelectColumns(Table.Sort(Conditions,{{"Custom", Order.Ascending}}),{"Custom", "Part", "Price"}),{"Part", "Price"}),
Mrg = Table.NestedJoin(Tbl2,{"Date"},Table.Combine({FillU, FillD}),{"Custom"},"Ap",JoinKind.LeftOuter),
ExpandR = Table.Distinct(Table.ExpandTableColumn(Mrg, "Ap", {"Part", "Price"}, {"Part", "Price"})),
Type = Table.TransformColumnTypes(Table.SelectRows(Table.Sort(ExpandR,{{"Date", Order.Ascending}, {"Part", Order.Ascending}, {"Price", Order.Ascending}}), each ([Price] <> null)),{{"Date", type date}})
in
Type