let
Source = Csv.Document(File.Contents("C:\Users\agent\OneDrive\Documents\3-12.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.Csv]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Company_Name", type text}, {"Filter_name", type text}, {"Request_ID", Int64.Type}, {"Print_Date", type date}, {"Transport", type text}, {"Delivery_Date", type date}, {"AU_Number", Int64.Type}, {"Route", type text}, {"Local#(lf)", type text}, {"Local#(lf)_1", type text}, {"ATM ID", type text}, {"Currency", type text}, {"Denomination", type text}, {"Current_Load", Int64.Type}, {"Fill_Method", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Currency] = "USD")),
#"Grouped Rows" = Table.Group(#"Filtered Rows", {"Denomination"}, {{"Count", each _, type table [Company_Name=nullable text, Filter_Name=nullable text, Request_ID=nullable number, Print_Date=nullable date, Transport=nullable text, Delivery_Date=nullable date, AU_Number=nullable number, Route=nullable number, #"Local#(lf)"=nullable number, #"Local#(lf)_1"=nullable number, ATM ID=nullable text, Currency=nullable text, Denomination=nullable text, Current_Load=nullable number, Fill_Method=nullable text]}}),
#"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Count", {"Company_Name", "Filter_Name", "Request_ID", "Print_Date", "Transport", "Delivery_Date", "AU_Number", "Route", "Local#(lf)", "Local#(lf)_1", "ATM ID", "Current_Load", "Fill_Method"}, {"Count.Company_Name", "Count.Filter_Name", "Count.Request_ID", "Count.Print_Date", "Count.Transport", "Count.Delivery_Date", "Count.AU_Number", "Count.Route", "Count.Local#(lf)", "Count.Local#(lf)_1", "Count.ATM ID", "Count.Current_Load", "Count.Fill_Method"}),
#"Pivoted Column" = Table.Pivot(#"Expanded Count", List.Distinct(#"Expanded Count"[Denomination]), "Denomination", "Count.Current_Load"),
#"Reordered Columns" = Table.ReorderColumns(#"Pivoted Column",{"Count.Company_Name", "Count.Filter_Name", "Count.Request_ID", "Count.Print_Date", "Count.Transport", "Count.Delivery_Date", "Count.AU_Number", "Count.Route", "Count.Local#(lf)", "Count.Local#(lf)_1", "Count.ATM ID", "Twenties", "Fifties", "Hundreds", "Count.Fill_Method"}),
#"Renamed Columns" = Table.RenameColumns(#"Reordered Columns",{{"Count.Company_Name", "Company_Name"}, {"Count.Filter_Name", "Filter_Name"}, {"Count.Request_ID", "Request_ID"}, {"Count.Print_Date", "Print_Date"}, {"Count.Transport", "Transport"}, {"Count.Delivery_Date", "Delivery_Date"}, {"Count.AU_Number", "AU_Number"}, {"Count.Route", "Route"}, {"Count.Local#(lf)", "Local#(lf)"}, {"Count.Local#(lf)_1", "Local#(lf)_1"}, {"Count.ATM ID", "ATM ID"}, {"Count.Fill_Method", "Fill_Method"}})
in
#"Renamed Columns"