Trying to figure out if this is even possible as LLMs have failed to answer this question.
I have a report from our companie's ERP that exports as a CSV. This is a basic inventory report that looks like this:
| Condition | Location | Part Number | Code | Count |
|---|---|---|---|---|
| Healthy | SHELF125 | CircutCard702 | FEP-275 | 1 |
| Healthy | SHELF125 | CircutCard702 | FEP-354 | 1 |
| Healthy | FLOOR290 | Engine200HP | Oshkosh1003 | 1 |
| Healthy | SHELF029 | Radio78800 | 50455B | 1 |
| Broken | FLOOR990 | Transmission9 | Nissan30120 | 1 |
| Broken | FLOOR790 | Radio78800 | 89004A | 1 |
| Broken | FLOOR790 | Radio78800 | 75605B | 1 |
The export list each item and their location in the factory floor and since each item has a code assigned to it as a serial number, the count for each item is essentially always 1.
I want to know if Power Query can import this and transform it to look like the following in Excel:
| Condition | Location | Part Number | Total / Code |
|---|---|---|---|
| Healthy | SHELF125 | CircutCard702 | 2 |
| Healthy | SHELF125 | FEP-354 | |
| Healthy | SHELF125 | FEP-354 | |
| Healthy | FLOOR290 | Engine200HP | 1 |
| Healthy | FLOOR290 | Oshkosh1003 | |
| Healthy | SHELF029 | Radio78800 | 1 |
| Healthy | SHELF029 | 50455B | |
| Broken | FLOOR990 | Transmission9 | 1 |
| Broken | FLOOR990 | Nissan30120 | |
| Broken | FLOOR790 | Radio78800 | 2 |
| Broken | FLOOR790 | 89004A | |
| Broken | FLOOR790 | 75605B |
Essentially, I want the first row to contain the sum of the quantity on that location. Then the following rows will omit the part number and just contain the unique codes for each of those items on that location. This makes it easier for our staff to read and they seem dead set in this formatting.
I got halfway there by grouping in Power Query but so far the LLMs have been unable to figure out how to get it to this final layout.
Is this something that can only be half done with Power Query and then I will have to move onto a OnChange macro to finish the layout?
Any help would be appreciated. Thank you.

