Power BI's Pivot Column feature in Power Query is designed to work with one value column at a time. When you need to pivot and aggregate multiple numeric columns simultaneously (like Sales, Cost, and Quantity), you must use specific techniques to achieve this.
You're consolidating departmental P&L data from a quarterly financial close. Each department (Marketing, Sales, Operations, Finance, HR) records revenues, direct costs, and profitability metrics monthly. Your finance director needs a pivoted consolidation where each month's five P&L metrics become column headers (Jan_Revenue, Jan_COGS, Jan_Gross_Margin, etc.) for board reporting.
Your source data exported from the general ledger (15 rows shown):
| Department | Month | Revenue | COGS | Gross_Margin | OpEx | EBIT |
|---|---|---|---|---|---|---|
| Marketing | Jan | 125000 | 45000 | 80000 | 35000 | 45000 |
| Marketing | Feb | 138000 | 52000 | 86000 | 38000 | 48000 |
| Marketing | Mar | 152000 | 58000 | 94000 | 41000 | 53000 |
| Sales | Jan | 285000 | 165000 | 120000 | 52000 | 68000 |
| Sales | Feb | 312000 | 185000 | 127000 | 55000 | 72000 |
| Sales | Mar | 351000 | 208000 | 143000 | 59000 | 84000 |
| Operations | Jan | 195000 | 118000 | 77000 | 28000 | 49000 |
| Operations | Feb | 205000 | 125000 | 80000 | 29000 | 51000 |
| Operations | Mar | 218000 | 133000 | 85000 | 31000 | 54000 |
| Finance | Jan | 82000 | 25000 | 57000 | 18000 | 39000 |
| Finance | Feb | 85000 | 28000 | 57000 | 19000 | 38000 |
| Finance | Mar | 91000 | 32000 | 59000 | 20000 | 39000 |
| HR | Jan | 65000 | 12000 | 53000 | 15000 | 38000 |
| HR | Feb | 68000 | 14000 | 54000 | 16000 | 38000 |
| HR | Mar | 72000 | 16000 | 56000 | 17000 | 39000 |
Financial grain: Each row = one department's monthly P&L. The five value columns (Revenue, COGS, Gross_Margin, OpEx, EBIT) are your income statement line items requiring pivot transformation.
Your finance director wants each department's full Q1 profile in one row:
| Product | Jan_Sales | Jan_Cost | Jan_Quantity | Feb_Sales | Feb_Cost | Feb_Quantity |
|---|---|---|---|---|---|---|
| Laptop | 1000 | 700 | 5 | 1200 | 800 | 6 |
| Phone | 500 | 300 | 10 | 600 | 350 | 12 |
The challenge: Power Query's Pivot Column only accepts one value column per operation.