let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Crash Date", type date}, {"Crash", Int64.Type}, {"On System Flag", type text}, {"Crash Latitude", type number}, {"Crash Longitude", type text}, {"Crash Severity", type text}, {"Highway", type text}, {"Reported Street Name", type text}, {"Reported Road Block Number", type text}, {"Reported Intersecting Street Name", type text}, {"First Harmful Event", type text}, {"Manner of Collision", type text}, {"Object Struck", type text}, {"Weather Condition", type text}, {"Light Condition", type text}, {"Crash Contributing Factor List", type text}, {"CountA", Int64.Type}}),
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Crash Date", "Crash", "Reported Street Name", "Reported Intersecting Street Name"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Other Columns", {"Crash Date", "Crash"}, "Attribute", "Value"),
#"Replaced Value" = Table.ReplaceValue(#"Unpivoted Other Columns","Reported Street Name","Main",Replacer.ReplaceText,{"Attribute", "Value"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Reported Intersecting Street","Secondary",Replacer.ReplaceText,{"Attribute", "Value"}),
#"Grouped Rows" = Table.Group(#"Replaced Value1", {"Value", "Attribute"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
#"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Value", Order.Ascending}})
in
#"Sorted Rows"
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "
Bookmarks