Forum Discussion

AdamWhittaker's avatar
2 years ago
Solved

Comma delimited fields split combine and filter in power query.

Hello, I am trying to figure out a way to split two fields via a comma, then add an index to each one then filter the first field to get one result and retrieve the same index from the 2nd command an...
  • ThxAlot's avatar
    2 years ago
    let
        IP = "127.0.0.1, 10.12.34.56, 169.254.23.56",
        Mac = "12-FE-23-6D-14-A6,13-FE-23-6D-14-A6,14-FE-23-6D-14-A6",
        #"To Table" = Table.FromColumns(List.Accumulate({IP, Mac}, {}, (s,c) => s & {List.Transform(Text.Split(c, ","), Text.Trim)}), {"IP","Mac"}),
        #"Added Index" = Table.AddIndexColumn(#"To Table", "Index", 0, 1, Int64.Type)
    in
        #"Added Index"