Forum Discussion
Identifying duplicates in one column
- 1 year ago
83dons ,
No worries! If you’re not comfortable with DAX, you can do this easily in Power Query as well—no formulas needed.
Here’s how:
- In Power Query, select the NNumber column.
- Go to the “Group By” option in the toolbar.
- Group by NNumber, and add an “All Rows” operation (or count if you want to see how many duplicates).
- Filter the grouped table to keep only NNumbers with a count > 1.
- Expand to show the original StaffID and NNumber columns.
Step-by-step:
- Home > Transform Data (opens Power Query)
- Select NNumber column > Home tab > Group By
- Group by NNumber, use “Count Rows” as the new column
- Filter the Count column for values greater than 1
- Expand the new column to get your StaffID/NNumber pairs
This will give you exactly the output you need—no DAX required!
translation and formatting supported by AI
Hi 83dons ,
Easiest way is to use a calculated column to flag duplicates, then filter. Here’s how you can do it in Power BI using DAX:
- Add a new calculated column:
IsDuplicate = CALCULATE( COUNTROWS('YourTable'), FILTER( 'YourTable', 'YourTable'[NNumber] = EARLIER('YourTable'[NNumber]) ) ) > 1
- Then, just filter your table (or visual) where [IsDuplicate] = TRUE.
This will show all rows where NNumber is duplicated, just like your output.
Let me know if you want a solution in Power Query or SQL as well!
Hi burakkaragoz I dont really use DAX is there a way to do this using the power BI ribbon at the top? Or can I just paste it into a transform step after the =
- burakkaragoz1 year agoSuper User
83dons ,
No worries! If you’re not comfortable with DAX, you can do this easily in Power Query as well—no formulas needed.
Here’s how:
- In Power Query, select the NNumber column.
- Go to the “Group By” option in the toolbar.
- Group by NNumber, and add an “All Rows” operation (or count if you want to see how many duplicates).
- Filter the grouped table to keep only NNumbers with a count > 1.
- Expand to show the original StaffID and NNumber columns.
Step-by-step:
- Home > Transform Data (opens Power Query)
- Select NNumber column > Home tab > Group By
- Group by NNumber, use “Count Rows” as the new column
- Filter the Count column for values greater than 1
- Expand the new column to get your StaffID/NNumber pairs
This will give you exactly the output you need—no DAX required!
translation and formatting supported by AI