Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Summing line data into a table format by category

I need to find a way to pull individual columns out and sum them up by category. I have included a simplified version of what I am trying to do. Anyone have any ideas on how to do this?

 

Data set

Product1SoldProduct1InventoryProduct2SoldProduct2InventoryProduct3SoldProduct3Inventory
104621522
11146181236

 

End report

Product #SoldInventory
Product 12118
Product 21220
Product 32758

 

 

2 Replies

  • bcdobbs's avatar
    bcdobbs
    Icon for Community Champion rankCommunity Champion

    Are you able to manipulate the data in power query?

    If so rough steps would be:

    1) Pivot the data so columns become rows.

    2) Add columns from selection to split Product1Sales into Product1 Sales etc.

    3) Unpivot the data back so you have a row per product with 3 columns Product, Sales, Inventory