Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Bonjour la communauté !
Je suis sûr qu'il a une solution à mon probleme mais je ne trouve pas.
Dans mon exemple ci joint (Tableau 1), j'ai un tableau dans lequel toutes les infos sont identiques.
Je voudrait dupliquer les lignes pas le nombre de la colonne Quantity (Tableau 2)
D'avance merci pour votre aide 🙂
Solved! Go to Solution.
Hi @Alecuyer75 ,
Mlawali is correct, the key query is to use Table.Repeat(), unpivot column could not be necessary in this issue.
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Table.Repeat(Table.FromRecords({[Quantity = 1]}),[Quantity])),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Quantity"}, {"Custom.Quantity"}),
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Bonjour,
Ajoute une Colonne personnalisé
Colle ce code dedans.
List.Repeat({""}, [Quantity])
ça ajoute une colonne liste.
Clique ensuite sur l'icone suivante dans l'entete de cette nouvelle colonne
Bonjour,
Ajoute une Colonne personnalisé
Colle ce code dedans.
List.Repeat({""}, [Quantity])
ça ajoute une colonne liste.
Clique ensuite sur l'icone suivante dans l'entete de cette nouvelle colonne
Petit oubli de ma part, lorsque tu clique sur l'icone il faut choisir "Développer sur de nouvelles lignes".
En vidéo ici.
https://www.youtube.com/watch?v=6NAQf9b5J14
Hi @Alecuyer75 ,
Mlawali is correct, the key query is to use Table.Repeat(), unpivot column could not be necessary in this issue.
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Table.Repeat(Table.FromRecords({[Quantity = 1]}),[Quantity])),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Quantity"}, {"Custom.Quantity"}),
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hello, im a beginner can you tell me where to write this code ? is it creating a new table for the result ?
Bonjour Eyaa,
Ce bout de code est a coller dans Power Query / Editeur avancé
Bonjour,
Essayez le code suivant:
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date Trans", "Trans Num", "Libelle Article", "Unit Price"}, "Attribute", "Value"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Custom", each Table.Repeat(Table.FromRecords({[Quantity=1]}),[Value])),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Quantity"}, {"Quantity"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Quantity", Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Attribute", "Value"})
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
48 | |
19 | |
13 | |
11 |