Forum Discussion
afzalbaharudin
Aug 30, 2022Copper Contributor
Excel Power Query Replace error in one column with values from another column
Hi wonderful community, I have an Excel table that I loaded to Power Query and I can't figure out how to replace Error values with the value in another column (See snapshot). Does...
- Aug 31, 2022
As variant
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes( Source, {{"Day", type date}, {"Earl.start", type date}}), #"Replaced Value" = Table.ReplaceValue( Table.ReplaceErrorValues(#"Changed Type", {{"Day", null }}), null, each _[Earl.start], Replacer.ReplaceValue,{"Day"}), DayToDate = Table.TransformColumnTypes( #"Replaced Value",{{"Day", type date}}) in DayToDate
SergeiBaklan
Aug 31, 2022Diamond Contributor
As variant
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(
Source,
{{"Day", type date}, {"Earl.start", type date}}),
#"Replaced Value" = Table.ReplaceValue(
Table.ReplaceErrorValues(#"Changed Type", {{"Day", null }}),
null,
each _[Earl.start],
Replacer.ReplaceValue,{"Day"}),
DayToDate = Table.TransformColumnTypes(
#"Replaced Value",{{"Day", type date}})
in
DayToDate