Forum Discussion

Jonnokc's avatar
Jonnokc
Frequent Visitor
10 years ago
Solved

Modifying a query help - adding new column skipping row 1

Hello,   How would I go about adding a new custom column to my query. I want to copy data from one column into a new one, but I want to skip the first row. So the new column would have the same dat...
  • greggyb's avatar
    greggyb
    10 years ago

    Smoupre raises a good point. This following solution will work if you want the last row to be blank, taking advantage of join semantics in Power Query.

     

    You'll create two indices on your table, the first starting from 0 and the second starting from one. Then you can merge this query with itself using the two indices, which are one off from each other. After self-merging the query, you can remove the index fields and be left with your original, and a copy that is one off. Pictures below:

     

    Add index from 0 (Default name = "Index") and one from 1 (Default name = "Index.1")Merge on Index.1 from the original, and Index on the second copy of the table (Current - bottom)Expand the table of values from the resulting merge and choose only the field you want to duplicateRemove the indices - you do not need them anymorePretty merged table