I have a single step conditional statement that works
BlanksToNull = Table.ReplaceValue(#"Trimmed Text","",null,Replacer.ReplaceValue,Table.ColumnNames(#"Trimmed Text")),
newMergedHeader = Excel.CurrentWorkbook(){[Name="newheader"]}[Content]{0}[Column1],
#"Merged Columns" =
if newMergedHeader <> null then
Table.CombineColumns(BlanksToNull,mergeHeaders[List Of Headers For Concatenation], each Combiner.CombineTextByDelimiter("|", QuoteStyle.None)(List.RemoveNulls(_)),"Merged"),
else
BlanksToNull
in
if newMergedHeader <> null then
#"Merged Columns"
else
BlanksToNull
But if newMergedHeader <> null I also want to add this
#"Renamed Columns" = Table.RenameColumns(#"Merged Columns",{{"Merged",newMergedHeader}})
Is there a way to add this to the existing If statement? or do I need to write a second If statement?
I tried
#"Merged Columns" =
if newMergedHeader <> null then
Table.CombineColumns(BlanksToNull,mergeHeaders[List Of Headers For Concatenation], each Combiner.CombineTextByDelimiter("|", QuoteStyle.None)(List.RemoveNulls(_)),"Merged"),
#"Renamed Columns" = Table.RenameColumns(#"Merged Columns",{{"Merged",newMergedHeader}})
else
BlanksToNull
But this does not work
Thanks