let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Market", "Employee name", "Branch Name"}, {{"Total Sales", each List.Sum([Sales Amount]), type number}, {"Total Profit", each List.Sum([Profit]), type number}}),
#"Reordered Columns" = Table.ReorderColumns(#"Grouped Rows",{"Market", "Branch Name", "Employee name", "Total Sales", "Total Profit"}),
#"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"Branch Name", Order.Ascending}, {"Market", Order.Ascending}})
in
#"Sorted Rows"