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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Selectively Remove Duplicates

Hi. The column with yellow highlights is the column that I want to remove duplicates. However, if I directly remove the duplicates, it removes the rows randomly. How can I select which one between the two rows that I want to remove the duplicates?

zhrhr_0-1614826620511.png


I want to remove the rows which starts with 'WELL..'. Note that I have all alphabets (PA, PB, PC, PD, PL and etc...)

zhrhr_1-1614826809374.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

Column =
IF(
    COUNTX(FILTER(ALL('Table'),[column1]=EARLIER([column1])),[column1])>1,
    IF(
    LEFT([column2],4)="WELL",1,0),
    0)

2. Create calculated table.

Table 2 =
SUMMARIZE('Table','Table'[column1],
"column2",CALCULATE(MAX('Table'[column2]),FILTER('Table','Table'[Column]=0)))

3. Result:

v-yangliu-msft_0-1615163786107.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@Anonymous , for that you need to have some kind of flag

https://exceleratorbi.com.au/remove-duplicates-keep-last-record-power-query/

https://community.powerbi.com/t5/Power-Query/remove-rows-based-on-condition-on-another-column/m-p/1082589

https://www.excelguru.ca/blog/2019/12/09/remove-dynamic-number-of-top-rows/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.