Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

throw news columns for the right

Hello,

I need help with a table. I need the original layout to be fixed, with possible new columns added between the pre-existing ones. These new columns should be moved to the right end, maintaining the original order as it was. The same applies when the columns are reorganized; in the analysis, the original order should be maintained.

  • hi Anonymous ,

     

    refer to this video:

    Dynamically Re-Order Columns in Power Query (youtube.com)

     

    the idea is:

    1. After dynamically grabbing column names using Table.ColumNames , convert this list into a table. add a custom column.

    2. Provide the original table structure, the position you would like, in the else clause put a high numeric value.

    3. in the reorder columns step, use the above created items.

     

    if this doesn't resolve the issue, kindly provide a sample input and output in a usable format ( excel, table, csv etc .) masking sensitive information 

2 Replies

  • adudani's avatar
    adudani
    Icon for Memorable Member rankMemorable Member

    hi Anonymous ,

     

    refer to this video:

    Dynamically Re-Order Columns in Power Query (youtube.com)

     

    the idea is:

    1. After dynamically grabbing column names using Table.ColumNames , convert this list into a table. add a custom column.

    2. Provide the original table structure, the position you would like, in the else clause put a high numeric value.

    3. in the reorder columns step, use the above created items.

     

    if this doesn't resolve the issue, kindly provide a sample input and output in a usable format ( excel, table, csv etc .) masking sensitive information