Home > Back-end >  Remove columns which have a number in that column name that is higher than threshold
Remove columns which have a number in that column name that is higher than threshold

Time:01-27

There is an example table with the following columns:

  • "Column A [68]"
  • "Column B [90]"
  • "Column C [29]"
  • "Column D [133]"
  • "Column E [56]"

How can all columns that have a number between the brackets that is higher than 80 be removed? (in this case "Column B [90]" and "Column D [133]")

CodePudding user response:

try

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Remove =  Table.RemoveColumns(Source,List.Select(Table.ColumnNames(Source), each Number.From(Text.BetweenDelimiters(_,"[", "]"))>80))
in Remove
  • Related