Forum Discussion
Mederic
6 months agoPost Patron
Transpose the 4 most recent dates
Hello everyone, I hope you are all well. I am attaching my sample file containing a tabble and Power Query code that is not working properly. Could you please improve it with a more elegant soluti...
- 6 months ago
Your pivot function is incorrect, referencing the wrong columns from the preceding step:
Table.Pivot(#"Colonnes dépivotées", List.Distinct(#"Colonnes dépivotées"[Attribut]), "Attribut", "Valeur")
Mederic
6 months agoPost Patron
Sorry, I went too fast, I didn't get the right result or couldn't get it.
I'll put the file that works.
However, I would have liked to reduce the number of steps.
Best regards
ronrsnfld
6 months agoSuper User
- What is the purpose of reducing the number of steps?
Any other problems with your output in your file? - To obtain the results you can either do the unpivot/pivot process (as in your example) or you could
demote headers/transpose/promote headers - What do you mean by the "four most recent dates"?
The dates you are showing in your results are merely the first four in your table which, because your table is sorted ascending, are merely the first four dates in your table. - Why are you using List.Sum in your pivot code? It seems you only have a single intersection of date/attribut so what are you trying to Sum?