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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Remove duplicates removing non duplicates

Hi all,

 

I am trying to remove duplicates from a column in a table with many rows via query editor. However, the query removes many of the non-duplicates value as well. The data source is Salesforce object, and I have not done any modifications to the data before this step. 

 

Below is an example for illustration:

1. When I filtered the column with only one value which is non-duplicate...

Capture.PNG

...and then remove duplicates....

Capture.PNG

...the row is maintained.

 

2. However, if I switched the two queries, so Remove Duplicates first and then Filtered rows. Then it returns empty table. So the Remove Duplicates has apparently remove this row, even though it contains non-duplicates value.

 

Has anyone experienced this issue before? Any ideas on what is causing this?

 

Thanks!

 

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

I can't reproduce your problem, could you provide more information?

 

I test with below table, 

id id2 col3 code date
1 1 FALSE 120 1/1/2018
2 1 TRUE 203 1/2/2018
3 2 TRUE 204 1/3/2018
4 2 FALSE 205 1/4/2018
5 3 TRUE 206 1/5/2018
6 3 FALSE 207 1/6/2018
7 4 TRUE 208 1/7/2018
8 5 FALSE 209 1/8/2018

Then write the code in Advanced editor, it works with this result

let
    Source = Excel.Workbook(File.Contents("C:\Users\maggiel\Desktop\case\12\12.20\12.20.xlsx"), null, true),
    Sheet6_Sheet = Source{[Item="Sheet6",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet6_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"id", Int64.Type}, {"id2", Int64.Type}, {"col3", type logical}, {"code", Int64.Type}, {"date", type date}}),
    new=Table.Distinct(#"Changed Type",{"id2"})
in
    new

11.png 

 

Could you show an example for me to test?

Perhaps it is something wrong when you do filtering, if this problem doesn't solve,  Could you show an example for me to test?

 

Please update power bi desktop to the lastest version to see if this problem exists.

https://docs.microsoft.com/en-us/power-bi/desktop-latest-update

 

Best Regards

Maggie

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.