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! Learn more

Reply
lardo5150
Microsoft Employee
Microsoft Employee

Need to validate Duplicates - Then Remove Duplicates

lardo5150_0-1645447310920.png

I am pulling data from a table in the dataverse.

 

Due to some issues last week, I have duplicates somewhere in this table.

I need to accomplish two things.

1.  I want to verify the duplicates before I delete them.

Duplicates will be the same items in crb3f_engineer_smpt, crb3f_assignment_time, and crb3f_case_number

I want to view these to see how many there are and if they are really duplicates.

 

2.  If I verify these need to go, I need a way to remove one of the entries, or merge them.

 

There could be a possibility there are triplets.

 

I already have an index column also.

lardo5150_0-1645447804188.png

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @lardo5150 ,

You can try to use Unpivot and pivot columns feature to remove duplicates values in rows, refer this sample query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSgeJYHQjPCYidwTwnKM8JzIsAsiKBOEopNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Added Index", {"Index"}, "Attribute", "Value"),
    #"Removed Duplicates" = Table.Distinct(#"Unpivoted Other Columns", {"Index", "Value"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Duplicates", List.Distinct(#"Removed Duplicates"[Attribute]), "Attribute", "Value")
in
    #"Pivoted Column"

vyingjl_0-1645692473015.pngvyingjl_1-1645692491138.png

 

Best Regards,
Community Support Team _ Yingjie Li
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
v-yingjl
Community Support
Community Support

Hi @lardo5150 ,

You can try to use Unpivot and pivot columns feature to remove duplicates values in rows, refer this sample query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSgeJYHQjPCYidwTwnKM8JzIsAsiKBOEopNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Added Index", {"Index"}, "Attribute", "Value"),
    #"Removed Duplicates" = Table.Distinct(#"Unpivoted Other Columns", {"Index", "Value"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Duplicates", List.Distinct(#"Removed Duplicates"[Attribute]), "Attribute", "Value")
in
    #"Pivoted Column"

vyingjl_0-1645692473015.pngvyingjl_1-1645692491138.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Under the Keep Rows GUI, there is "Keep Duplicates" which will return your duplicates into a separate table. "Remove Duplicates" will remove duplicates.

 

--Nate

hmmm, let me try it again.

I did that but it never created another table.

Not all columns will have the duplicate.

I highlighte the three columns that I belive will have the duplicate information.  I then do keep duplicates.

Got the spinning wheel for a minute or so, then nothing.

lardo5150
Microsoft Employee
Microsoft Employee

sorry, I am not understanding.

I am in PowerBi, not Power Apps.

ClearCollect is a PowerApp cmdlet I thought?

Syndicate_Admin
Administrator
Administrator

For performing this you can create collection  to remove duplicates

PowerApps Remove Duplicate in a Collection
for looking duplicates we have to check with the distinct function
  1. ClearCollect(colDistinct,Distinct(colSample,CreatedDate));
  2. Clear the collection before collect. by using function  => Clear(colFinal);
  3. Loop through the Distinct collection and get the first item from the main collection   ForAll(colDistinct,Collect(colFinal,First(Filter(colSample,CreatedDate = Result))
    )
    );  you can try these functions on collection.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors