Pivot Table Issues

How to Show Unique Selected Options by City in an Excel Pivot Table

Kushani NimanthikaKushani Nimanthika Nov 2, 2026 870 views

Question details

The user wants to create an Excel summary displaying unique selected options for each city without showing duplicate values.

How to Show Unique Selected Options by City in an Excel Pivot Table
Product
Microsoft Excel
Device & OS
not provided
Scenario
Analyzing survey or selection data where multiple responses per city need to be summarized into unique comma-separated strings or grouped lists.
Observed behavior
Cities with repeated selections display duplicate values (e.g., 1, 2, 1, 1, 2) instead of a clean, deduplicated summary of unique options (e.g., 1, 2).
Before you start

Ensure your source data is formatted as an Excel Table by selecting your data and pressing Ctrl+T. This allows Power Query to dynamically read your data range.

Solution 1Recommended

Use Power Query to Remove Duplicates and Group Data

Power Query is the most reliable tool in Excel to clean duplicate city-option combinations and merge the remaining unique values for your final summary.

By removing duplicate rows before grouping the data, you ensure that even if a city selected the same option multiple times, it will only be processed and displayed once in the final output.

1
Load data into Power Query

Select any cell inside your data table. Navigate to the 'Data' tab on the Excel ribbon and click 'From Table/Range' to open the Power Query Editor.

2
Remove duplicate combinations

Hold the Ctrl key and click on the headers for both the 'City' and 'Option' columns to select them. Right-click either header and choose 'Remove Duplicates'.

3
Group data by city

Select the 'City' column. On the Home tab of the Power Query Editor, click 'Group By'. In the dialog box, set a New column name (e.g., 'GroupedOptions'), choose 'All Rows' as the Operation, and click OK.

4
Combine unique options

Add a Custom Column via the 'Add Column' tab. Use the formula `Text.Combine([GroupedOptions][Option], ", ")` to merge the deduplicated options into a single comma-separated string per city. Remove the intermediate 'GroupedOptions' column.

5
Load the summary back to Excel

Click 'Close & Load' on the Home tab. The summarized, deduplicated data will be loaded into a new Excel worksheet, ready for reporting or further Pivot Table analysis.

Use Power Query to Remove Duplicates and Group Data
Dynamic Updates: When your source data changes, simply right-click the new summary table and select 'Refresh' to automatically process new unique options.
Efficient Data Analysis with WPS Office

Manage Data and Remove Duplicates Easily with WPS Spreadsheet

WPS Spreadsheet offers an intuitive interface to clean data, remove duplicates, and build powerful Pivot Tables. It is a highly efficient alternative for organizing city and option summaries without complex coding.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your existing data file.
  2. 2. Remove duplicates directly: Highlight your entire data range. Go to the Data tab and click 'Remove Duplicates'. Ensure both the City and Option columns are checked, then click OK.
  3. 3. Insert a Pivot Table: With the cleaned data selected, go to the Insert tab and click 'PivotTable'.
  4. 4. Configure the layout: Drag the 'City' field to the Rows area and the 'Option' field to the Columns or Values area to instantly view unique selections per city.
Fully compatible with Microsoft Excel (.xlsx) filesBuilt-in Data Deduplication tools for fast data cleaningAdvanced Pivot Table functionality for clear summariesFree and lightweight software for faster processing
microsoft office alternative - wps office

Frequently Asked Questions

Can I show unique text values directly inside a standard Excel Pivot Table?

Standard Pivot Tables are designed to aggregate numerical data (Sum, Count, Average). To display combined text strings (like 'Option A, Option B'), you must use Power Query or add the data to the Data Model and use a DAX measure like CONCATENATEX.

How do I access Power Query in older versions of Excel?

In Excel 2016 and later, Power Query is built-in under the Data tab in the 'Get & Transform' section. For Excel 2010 and 2013, it must be downloaded and installed as a free add-in from Microsoft.

Does removing duplicates in Power Query affect my original source data?

No. Power Query operates as a separate data transformation layer. It reads your original data, applies the 'Remove Duplicates' step in memory, and outputs a new table, leaving your original dataset completely untouched.