Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Money
Helper I
Helper I

Remove duplicates of number

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 dataexpected data

1

1
12
23
34
--
4taken
takentaken
taken5
56
3-
67
- 
7 

 

Please suggest me how to approach. 

Thanks in advance 🙂 

@tamerj1  @amitchandak @Greg_Deckler @Arul @v-zhangti @PowerQuerryGuru @Ashish_Mathur @FreemanZ

1 REPLY 1
AlexisOlson
Super User
Super User

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors