• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

PQ Grouping

Tripp

Member
Hello,

I have starting using PQ and am trying to use the group function.

I have a spreadsheet with 5 headings: Doc No,Primary Folder, Secondary Folder, Tran, Date.

Each Doc number is assigned to a P & S folder with a date and Tran code and I would like to group the docs by P and S folder showing a count of of the individual dates and Tran codes for the documents.

I have attached a sample file as that is probably much easier to understand.

Any help appreciated.
Tripp
 

Attachments

  • EXCEL TEST.xlsx
    12.6 KB · Views: 2
Here is the M Code based upon my understanding of your issue

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Document No", type number}, {"P Folder", type text}, {"S Folder", type text}, {"Date", type datetime}, {"Tran", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"P Folder", "S Folder", "Date"}, {{"Count", each Table.RowCount(_), type number}})
in
    #"Grouped Rows"
 
Hi AlanSidman,

That works really well. One issue is that there is no tran column. Do you know how I would add this without changing the grouping?

Regards,
Sam
 
Back
Top