Forum Discussion
extract minimum and maximum in a category?
- 6 years ago
Hello Anonymous ,
Use Table.Group for this and select Min and Max for the Date-column .
Here a code example
let Source = #table ( {"Project","Date"}, { {"A","43466"}, {"A","43467"}, {"A","43468"}, {"A","43469"}, {"B","43470"}, {"B","43471"}, {"B","43472"}, {"B","43473"}, {"B","43474"}, {"C","43475"}, {"C","43476"}, {"C","43477"}, {"C","43478"} } ), ToDate = Table.TransformColumns ( Source, { { "Date", each Date.From(Number.From(_)), type date } } ), Group = Table.Group(ToDate, {"Project"}, {{"Min", each List.Min([Date]), type date}, {"Max", each List.Max([Date]), type date}}) in GroupCopy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
- Jimmy8016 years agoCommunity Champion
Hello Anonymous ,
Use Table.Group for this and select Min and Max for the Date-column .
Here a code example
let Source = #table ( {"Project","Date"}, { {"A","43466"}, {"A","43467"}, {"A","43468"}, {"A","43469"}, {"B","43470"}, {"B","43471"}, {"B","43472"}, {"B","43473"}, {"B","43474"}, {"C","43475"}, {"C","43476"}, {"C","43477"}, {"C","43478"} } ), ToDate = Table.TransformColumns ( Source, { { "Date", each Date.From(Number.From(_)), type date } } ), Group = Table.Group(ToDate, {"Project"}, {{"Min", each List.Min([Date]), type date}, {"Max", each List.Max([Date]), type date}}) in GroupCopy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy- Anonymous6 years agoNot applicable
thank you so much, made my day!!!