All courses available in-class or via remote login

Group By in Power Query

Using Group By in Power Query

September 19, 2017

Using Group By in Power Query

Group By is an excellent feature in Power Query to group related rows by a column. This is useful when you have multiple entries for related rows and you want to combine them into one row based on a common attribute value. This example will illustrate this in detail

Consider a query with sales orders for employees across different states and dates.

Rows 2 and 3 has the sales orders for Bob in WA on 9/08/2016. There might be further such rows in the query where related rows might have multiple Orders. We want to combine the data such that there is only one row for each combination of Employee, State, and Date and an Orders column which sums up the orders for related rows.

Click on the Date column and go to Transform and select Group By to bring up the Group By window. Select the Advanced option at the top and fill out the sections like below and hit OK.

Group By

 

The Query now looks like this. Bob’s orders on 09/08/2016 in WA has now been summed to 62 in the Number of Orders columns and since there were two orders for Bob, the Count Orders column reflects that.

Power Query count

 
 

Check out our Power BI courses here.

 

 

What is Remote Training?

Valued by Individuals

 

4.8/5
Over 21505 Reviews
So much was covered and John stayed back to ensure we did not miss any of the curriculum, fantastic -Office365 Beginner Melbourne
Julie - Office365 Beginner, .
I was the only student so everything was tailored around me which was fantastic -Office365 Intermediate Perth
Julie - Office365 Intermediate, .
Overall training was good -Power BI Beginner Perth
Archie - Power BI Beginner, .
Great intro to Power BI -Power BI Beginner Perth
Ara - Power BI Beginner, .
Thanks David. Good start into the Power BI World. -Power BI Beginner Perth
Juanita - Power BI Beginner, .
Great course, I have learned a lot that I can implement in my workplace. Thanks Steven -Office365 Intermediate Brisbane
Jules - Office365 Intermediate, .
Great, while I knew most of it I obtained some golden ideas. See you in a month for the advanced course. -Office365 Intermediate Brisbane
David - Office365 Intermediate, .
Very useful thank you. Jagg has been very nice and helpful. -Excel Intermediate Adelaide
Cassia - Excel Intermediate, .
Great course. Learnt so much -Excel Intermediate Adelaide
Kacey - Excel Intermediate, .
It was great! Very great at explaining concepts. -Excel Intermediate Adelaide
James - Excel Intermediate, .
Course was very informational, however, I probably should have done the advanced class - it was a lot of stuff I already knew with a few hidden advantages. Course trainer Jagg is very knowledgeable and hosted a professional training session, -Excel Intermediate Adelaide
Chantelle - Excel Intermediate, .
clear and useful information, Jagg kept the course interesting and was very helpful. thank you. -Excel Intermediate Adelaide
Vanessa - Excel Intermediate, .
Course will be very useful for new role at work. -Power BI Beginner Melbourne
Alex - Power BI Beginner, .
Thank you -Power BI Beginner Melbourne
Amonrat - Power BI Beginner, .
Well done. Now I will practice -Power BI Beginner Melbourne
Jamie - Power BI Beginner, .
It was interesting. Learnt a few new things -Power BI Beginner Melbourne
Purva - Power BI Beginner, .
Great session, very simple to use and easy to follow along. Thanks for a great session. -Power BI Beginner Melbourne
Lindsey - Power BI Beginner, .
great beginner course! -Power BI Beginner Melbourne
Sarah - Power BI Beginner, .
John was really good at explaining and answering queries. Few technical difficulties with some students who is was able to sort out there problems. -Power BI Beginner Melbourne
Aaron - Power BI Beginner, .
Good session, very informative and took a lot from it -Power BI Intermediate Sydney
Nathan - Power BI Intermediate, .

Trusted by Business

Procured by Government

Map of Australia