Forum Discussion

Michael_HERE's avatar
Michael_HERE
Regular Visitor
2 years ago
Solved

How to replace a value in multiple columns when the columns have to be dynamically selected?

I need to replace a value in a set of columns (in this case null value with 0), but I cannot hard-code the columns. Instead, I need to determine the columns dynamically: only columns with a specific ...
  • wdx223_Daniel's avatar
    2 years ago
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        FilteredList = List.Buffer(List.Select(Table.ColumnNames(Source), each Text.StartsWith( _ , "Invoiced_"))),
        #"Replaced Value" = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue, FilteredList)
    in
        #"Replaced Value"