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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
abdalla
Helper I
Helper I

duplicates

hello im using power query and i have a big set of data where the names in my list sometimes repeat up to 6 times.

My question is, Is there anyway that i can remove 4 of them and keep only 2 or if i remove duplicates than all will be gone ,

I need the calculation done to them.

abdalla_0-1656567939401.png

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @abdalla 

 

You can try to solve this problem with Dax in desktop.

Column:

Rank = 
RANKX(FILTER('Table',[Well]=EARLIER('Table'[Well])),[Row],,ASC)

vzhangti_0-1656942234070.png

Table:

Table 2 = 
Var _table=
SUMMARIZE('Table','Table'[Row],'Table'[Well],'Table'[WHAT],'Table'[Rank])
return
FILTER(_table,[Rank]<=2)

vzhangti_1-1656942271215.png

Does this meet your desired outcome?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

Hi @abdalla 
Which two shall be kept?

Hi  @tamerj1 

the original data set didnt have any coloumn to the right of the string column, I am calculating the string and well name from the well column and reservior column

You will find that some wells are the exact same and have the same reservior number so my request is how do i formulate it so that excel only takes one of these entries. 

tamerj1
Super User
Super User

@abdalla 
In this case if you select all the columns from "Well" to "Reservoir" then "Remove Duplicates" will keep 2 rows.

im only looking for to keep 2 of the duplicates because the duplication comes in the well column but when it comes to the reservoir no. column i need to keep 2 numbers there, 

i tried the remove duplicates before and it literally removed them i need to keep them but not calculate them.

 

v-zhangti
Community Support
Community Support

Hi, @abdalla 

 

You can try to solve this problem with Dax in desktop.

Column:

Rank = 
RANKX(FILTER('Table',[Well]=EARLIER('Table'[Well])),[Row],,ASC)

vzhangti_0-1656942234070.png

Table:

Table 2 = 
Var _table=
SUMMARIZE('Table','Table'[Row],'Table'[Well],'Table'[WHAT],'Table'[Rank])
return
FILTER(_table,[Rank]<=2)

vzhangti_1-1656942271215.png

Does this meet your desired outcome?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric 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.

Users online (29)