Forum Discussion
Zoplie
3 years agoRegular Visitor
Power query : Need help on math column/Header value
Hello, I need your help on power query to retrieve data from a second table according to the header column and the value of the first column. I have a table with country, city and population. A se...
slorin
3 years agoSuper User
Bonjour
Pour obtenir la table de gauche à partir de celle de droite il suffit de pivoter la colonne "Country" avec la colonne de valeur "Nb" et de choisir l'option avancée "ne pas agréger".
J'ajoute un index avant pour récupérer ensuite l'ordre initial par un tri
let
Source = Votre_Source,
#"Index ajouté" = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
#"Colonne dynamique" = Table.Pivot(#"Index ajouté", List.Distinct(#"Index ajouté"[Country]), "Country", "Nb"),
#"Lignes triées" = Table.Sort(#"Colonne dynamique",{{"Index", Order.Ascending}})
in
#"Lignes triées"
Stéphane