Concatenate Text and Sum Values by Category in an Excel PivotTable
Question details
Combine text from two columns and sum numeric values for each category in an Excel PivotTable.

- Product
- Microsoft Excel PivotTable
- Device & OS
- not provided
- Scenario
- The source data contains two text columns, a category column, and a numeric column that need to be summarized by category.
- Observed behavior
- The desired result is a category-level list of combined text values alongside a numeric total.
Arrange the source data in columns with headers, including a category, two text fields, and a numeric amount. Check that your Excel edition supports the Data Model and Power Pivot measures.
Use Data Model measures to concatenate text and sum amounts
Use this method when you need both results inside an Excel PivotTable.
A standard PivotTable can sum numbers but does not normally concatenate text values. DAX measures in the Data Model can calculate both results in the context of each category.
The examples assume a source table named SourceData with columns named Category, Text1, Text2, and Amount. Replace these names with your own.
Select the data and choose Insert > Table. On the Table Design tab, set the table name to SourceData or note its existing name.
Select a cell in the table, choose Insert > PivotTable, and select Add this data to the Data Model before creating the PivotTable.
Choose Power Pivot > Measures > New Measure. Select SourceData, name the measure Combined Text, and enter the formula =CONCATENATEX('SourceData', 'SourceData'[Text1] & " " & 'SourceData'[Text2], ", ").
Choose Power Pivot > Measures > New Measure again. Select SourceData, name the measure Total Amount, and enter =SUM('SourceData'[Amount]).
In PivotTable Fields, drag Category to Rows and drag Combined Text and Total Amount to Values. Each category row will show its combined text pairs and amount total.

Combine text and totals by category in WPS Spreadsheet
In WPS Spreadsheet, sort rows by category and use worksheet formulas to combine text and sum amounts for each group. This produces a summary outside a PivotTable.
- 1. Open and arrange the data: Open the workbook in WPS Spreadsheet. Arrange Text1, Text2, Amount, and Category in columns A through D, with headers in row 1.
- 2. Combine each text pair: In E1, enter Combined Text. In E2, enter =A2&" "&B2, then drag the fill handle down to the last data row.
- 3. Group the categories: Select columns A through E and use Data > Sort to sort the entire selection by the Category column. Note the first and last row of each category.
- 4. Calculate each summary: In a separate summary area, enter each category name. For a category occupying rows 2 through 4, use =TEXTJOIN(", ",TRUE,E2:E4) for its text and =SUM(C2:C4) for its total. Adjust the ranges for each category.

Frequently Asked Questions
Can a standard Excel PivotTable concatenate text in the Values area?
Not normally. Create the PivotTable with Add this data to the Data Model selected, then use Power Pivot > Measures > New Measure to add a CONCATENATEX measure.
How does the DAX formula know which category to summarize?
When you place Category in the PivotTable Rows area, each category row filters the Data Model. CONCATENATEX and SUM then calculate over the matching source rows.
Why does the combined text contain repeated entries?
The example CONCATENATEX measure includes one text pair per source row. If identical pairs occur more than once, they appear more than once in the result.
What if I cannot find Power Pivot or the Data Model option?
Check whether your Excel edition supports Power Pivot and whether the add-in is enabled. Alternatively, sort the source rows by category and use worksheet formulas such as TEXTJOIN and SUM for each group.




