You are learning Power Query in MS Excel
How to group and aggregate data using Power Query (SUM, AVERAGE, COUNT)?
Here's how to group and aggregate data using Power Query (SUM, AVERAGE, COUNT):
1. Group By:
* Select the columns you want to group your data by.
* Go to the Home tab in Power Query Editor.
* Click on Group By.
Advanced Grouping (Optional):
* If you want to group by multiple columns, select Advanced in the Group By dialog box.
* Click Add grouping for each additional column you want to include in the grouping.
2. Add Aggregations:
* In the Group By dialog box, under New column name, enter a name for your aggregated column (e.g., Total Sales).
* From the Operation dropdown, select the aggregation function you want to use (SUM, AVERAGE, COUNT, etc.).
* In the Column dropdown, select the column you want to aggregate (e.g., Sales).
3. Expand or Collapse Groups (Optional):
* You can expand or collapse groups to see the underlying data by clicking the plus or minus signs next to the group headers in the results.
4. Additional Options:
* You can also keep all rows expanded (Show all rows) or only the top or bottom N rows within each group.
* Power Query offers other aggregation functions like MIN, MAX, VAR.P, etc.
Here's an example:
Suppose you have a dataset with columns for Product, Color, and Quantity. You want to find the total quantity sold for each product.
1. Group By: Select the Product column.
2. Add Aggregation: Name the new column "Total Quantity", select SUM from Operation and choose Quantity from Column.
This will create a new table summarizing the total quantity sold for each unique product.