Create a Distribution Matrix in Excel from Source and Destination Data
Question details
Create a matrix that displays distribution values by source and destination.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- The source table contains Source, Destination, and Distribution columns, and the user wants sources as rows and destinations as columns.
- Observed behavior
- The desired matrix should show the corresponding distribution value at each source and destination intersection.
Check that the source data has headers for Source, Destination, and Distribution, and that distribution values are numeric. Decide whether repeated source-destination pairs should be summed or treated as separate records.
Pivot Destination in Power Query
Use Power Query to create a refreshable matrix, especially for a large or changing dataset.
Select a cell in the source data and choose Data > From Table/Range. Confirm that the table has headers.
In Power Query Editor, select the Source, Destination, and Distribution columns, then use Home > Remove Columns > Remove Other Columns.
Select the Destination column and choose Transform > Pivot Column. In the dialog, select Distribution as the Values Column.
Under Advanced options, select Sum if repeated source-destination pairs should be added. If each pair is unique, you can select Don't Aggregate instead, then click OK.
Choose Home > Close & Load to return the matrix to Excel. After changing the source data, use Data > Refresh All to update it.

Build a Distribution Matrix with SUMIFS
Use a formula-based matrix when you have a smaller table and can list the sources and destinations yourself.
Build a Distribution Matrix with a WPS PivotTable
Use a PivotTable in WPS Spreadsheet to arrange sources as rows, destinations as columns, and distribution values in the matrix.
- 1. Open the data: Open your workbook in WPS Spreadsheet and select a cell in the source table.
- 2. Insert a PivotTable: Choose Insert > PivotTable, confirm the data range, and choose where to place the PivotTable.
- 3. Arrange the fields: Drag Source to Rows, Destination to Columns, and Distribution to Values in the PivotTable field list.
- 4. Check the calculation: Open the Distribution value field settings and select Sum if repeated source-destination values should be added. Use the PivotTable refresh command after updating the source data.

Frequently Asked Questions
Which column should I pivot in Power Query?
Select Destination and choose Transform > Pivot Column. Set Distribution as the Values Column so each destination becomes a matrix column.
What happens if a source and destination appear more than once?
Choose Sum in the Pivot Column advanced options to add their distribution values. Don't Aggregate requires each source-destination pair to be unique.
How do I update the matrix after changing the source data?
In Excel, choose Data > Refresh All to reload the Power Query result. Make sure new records are included in the source table.
Why does a matrix cell show null or zero?
A null in Power Query can mean there is no matching source-destination record. A SUMIFS formula returns zero when there is no match, though zero can also be the sum of matching values.




