Power Query Custom Column to count number of instances - multiple criteria

tbablue

Active Member
Joined
Apr 29, 2007
Messages
488
Office Version
  1. 365
Platform
  1. Windows
Hi Forum,

I have a table called 'Output' - the table has just five (5) fields; Index, Checker, Title, Manager ID, Role Type.

I want to introduce a custom column in Power Query that will count the number of entries that are matched in 'Checker', 'Title', and 'Manager ID'.

Most grateful for any assistance.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I used a combination of GROUP & INDEX Column to do this.

This was the solution that I found.

 
Upvote 0
Thanks for posting your solution. The video explains how to group data for aggregation.
So you could mark your own answer post as the solution.

Additionally, to help future readers and make this question more useful, here is how it is done in words.
Select Checker, Title, and Manager ID columns, right-click on the headers, and Group By, then select Count for the operation.

1686514231097.png


1686514345725.png



The following is the M code for the same scenario:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name = "Table1"]}[Content],
    GroupRows = Table.Group(Source, {"Checker", "Title", "Manager ID"}, {{"Count", each Table.RowCount(_)}})
 in
    GroupRows
 
Upvote 0
Solution
Thanks for posting your solution. The video explains how to group data for aggregation.
So you could mark your own answer post as the solution.

Additionally, to help future readers and make this question more useful, here is how it is done in words.
Select Checker, Title, and Manager ID columns, right-click on the headers, and Group By, then select Count for the operation.

View attachment 93347

View attachment 93348


The following is the M code for the same scenario:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name = "Table1"]}[Content],
    GroupRows = Table.Group(Source, {"Checker", "Title", "Manager ID"}, {{"Count", each Table.RowCount(_)}})
 in
    GroupRows
Thank you for taking the time to respond. I know that some members don't show the appreciation that they should. I'm most grateful and really appreciate your time and attention.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top