Forum Discussion
PhilippeMuniesa
Resolver I
6 years agocolumns select from X to the last
hello champions. I'm a beginner, and French. A lot of handicaps, ... then. I built a table with powerQuery and I would like to sort the columns of this table in ascending order. e.g. my origi...
- 6 years ago
Merci, je vais essayer et je te tiens au courant.
Cordialement
Philippe
PhilippeMuniesa
Resolver I
6 years agoSorry, the title of my post is not the right one, it's about sorting the columns of a table
Thank you
Philippe
CNENFRNL
Community Champion
6 years agoSalut, PhilippeMuniesa , puisque tout ce que tu voulais est de trier les colonnes, je te propose une méthode comme ça,
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1NNA1MFTSUXIE4gggNgJiQwMgYQzEJkqxOkjqQHJOQBwJxJZAbArFhqjKQDqdgTgKiC2gRpqBlcbGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Piece = _t, Designation = _t, #"7071" = _t, #"6035" = _t, #"708" = _t, #"401" = _t]),
#"Reordered Columns" = Table.ReorderColumns(Source,
let
Headers = Table.ColumnNames(Source),
#"Fixed Headers" = List.FirstN(Headers, 3),
#"Sorted Headers" = List.Sort(List.Skip(Headers, 3), Order.Ascending)
in
#"Fixed Headers" & #"Sorted Headers"
)
in
#"Reordered Columns"- PhilippeMuniesa6 years ago
Resolver I
Merci, je vais essayer et je te tiens au courant.
Cordialement
Philippe