# Consolidate by 3 collumns



## MutanGFX (Dec 28, 2022)

I need help coming up with a solution to consolidate data like this:

Before:
DATEECOMSKUQUANT04/01/20222103986105/01/20222103943105/01/20222102977106/01/20222103986107/01/20229103943107/01/20222106964107/01/20222106964107/01/20225106964108/01/20225106964108/01/20228103943108/01/20221106964108/01/20222106964109/01/20228103943109/01/20228106964109/01/20222106964110/01/202291039431

After:
DATEECOMSKUQUANT05/01/20222102977105/01/20222103943108/01/20228103943109/01/20228103943107/01/20229103943110/01/20229103943104/01/20222103986106/01/20222103986108/01/20221106964107/01/20222106964208/01/20222106964109/01/20222106964107/01/20225106964108/01/20225106964109/01/202281069641

In the consolidated table I need each row to contain the DATE, the ECOM, the SKU and the SUM of QUANT by DATE, ECOM and SKU.


----------



## DanteAmor (Dec 28, 2022)

Try a pivot table
Example:


----------



## alansidman (Dec 28, 2022)

another way is to aggregate using Power Query

```
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"DATE", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"DATE", "ECOM", "SKU"}, {{"Total ", each List.Sum([QUANT]), type number}})
in
    #"Grouped Rows"
```


----------

