A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi,
This M code in Power Query works as well
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"Product A", Int64.Type}, {"Product B", Int64.Type}, {"Product C", Int64.Type}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date"}, "Attribute", "Value"),
#"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {"Attribute"}, {{"Value for earliest date", each Table.Min(_,"Date")},{"Value for farthest date", each Table.Max(_,"Date")}}),
#"Expanded Value for earliest date" = Table.ExpandRecordColumn(#"Grouped Rows", "Value for earliest date", {"Value"}, {"Value"}),
#"Expanded Value for farthest date" = Table.ExpandRecordColumn(#"Expanded Value for earliest date", "Value for farthest date", {"Value"}, {"Value.1"})
in
#"Expanded Value for farthest date"