Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sjtalkar/b76740fd152b962314747fb4ef7c4478 to your computer and use it in GitHub Desktop.
Save sjtalkar/b76740fd152b962314747fb4ef7c4478 to your computer and use it in GitHub Desktop.
Reorder cols dynamically in M Query
curr_col_list = Table.ColumnNames(fill_section_down),
last_col = List.LastN(curr_col_list, 1),
first_cols = List.FirstN(curr_col_list, List.Count(curr_col_list) - 1),
new_col_order = List.Combine(last_col, first_cols),
reordered_table = Table.ReorderColumns(remove_first_col, new_col_order),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment