0

I have:

column1 | column2 | colum3
a;b;c   | x;y;z   | door;house;tree

Desired result using Excel powerquery:

 a      | x       | door
 b      | y       | house
 c      | z       | tree

I tried with: Text.Split([column1],";") and expand to new lines, obtaining:

a
b
c

However when tried the same with other values, new lines are created instead to use the existent ones.

1 Answer 1

1

You may use this code:

let
    Source = Excel.CurrentWorkbook(){[Name="Table"]}[Content],
    rec = Table.ReplaceValue(Source,0,0,(a,b,c)=>Text.Split(a,";"),{"column1", "column2", "column3"}){0},
    table = #table(Record.FieldNames(rec),List.Zip(Record.FieldValues(rec)))
in
    table
Sign up to request clarification or add additional context in comments.

1 Comment

It only works with the first line. But in any case thanks your example I learned the key for the trick is to use "List.Zip". Using it, I solved the problem. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.