Forum Discussion
Dicken
Post Prodigy
1 year agoAdding columns
I wanted to a make table columns consistent and came up with re order , what was in the columns was irrelevaant, so ; let
Source = #table ( type table [ One = Text.Type, Five = Text.Type,
T...
- 1 year ago
Hi Dicken,
Another interesting approach I could think of was this, thanks
Before Re-Ordering, to add more columns, two functions List.RemoveMatchingItems and List. Accumulate, here's howPost this, follow up with the Re-ordering given below
1. Extracting ColNames and Loading it to Excel
2. Adding a Order Number Column in Excel as per the order you'd like
3. Load this new data back into Power Query (here, that is Col Order)
4. Last stepm using the Order Number col, arrange the data in ascending or descending order5. Just use that query in the Table.ReorderColumns Function
slorin
Super User
1 year agoHi Dicken
let
Source = #table ( type table [ One = Text.Type, Five = Text.Type,
Three = Text.Type ] ,
{{"a","b","b"}, {"b","c","d"} , {"d","a","c"}} ),
allcol = {"One","Two", "Three", "Four", "Five"},
Custom1 = #table(allcol, List.Repeat({},List.Count(allcol))) & Source
in
Custom1
Stéphane