Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all
I'm tring to remove duplicates from the column.
column presents numbers, - , and Taken.
I need to remove only number duplicates and needs to keep "-" and "Taken" as it is.
Sharing below the current data and expected data.
| current data | expected data |
1 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 4 |
| - | - |
| 4 | taken |
| taken | taken |
| taken | 5 |
| 5 | 6 |
| 3 | - |
| 6 | 7 |
| - | |
| 7 |
Please suggest me how to approach.
Thanks in advance 🙂
@tamerj1 @amitchandak @Greg_Deckler @Arul @v-zhangti @PowerQuerryGuru @Ashish_Mathur @FreemanZ
You can do a Group By where you make sure "taken" and "-" are treated uniquely.
Here's a sample query you can paste into the Advanced Editor in a new blank query:
let
Source = Table.FromColumns({{"1", "1", "2", "3", "-", "4", "taken", "taken", "5", "3", "6", "-", "7"}}, {"current data"}),
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [current data] = "taken" or [current data] = "-" then [Index] else 0, Int64.Type),
#"Grouped Rows" = Table.Group(#"Added Custom", {"current data", "Custom"}, {}),
#"Removed Other Columns" = Table.SelectColumns(#"Grouped Rows",{"current data"})
in
#"Removed Other Columns"
This creates a unique index but then zeros it out for the numbers so that they aren't treated uniquely.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!