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
dodonald
Helper I
Helper I

Remove Duplicates for filtered data then unfilter

I have a very big dataset with many steps in the query. I need to add a step to remove duplicates ONLY for tasks where:

  • assigneerole = Change Administrator I, Change Administrator II, or Change Administrator III

AND

  • status <> completed

In this example, I only want to keep 1 of the first 3 lines (it really doesnt matter to me which line, just that there are only 1) and preserve the other lines as they are.

subjectidstatusassignee_useridassigneerolecreatedon
1050052889POTENTIALPerson ACHANGE ADMINISTRATOR I10/11/2023
1050052889POTENTIALPerson BCHANGE ADMINISTRATOR I10/11/2023
1050052889POTENTIALPerson CCHANGE ADMINISTRATOR I10/11/2023
1050052889POTENTIALPerson ACHANGE OWNER10/11/2023
1153033046AssignedPerson ACHANGE ADMINISTRATOR I10/1/2023
1177721261AssignedPerson BCHANGE OWNER10/1/2023
1149606076AssignedPerson CCHANGE ADMINISTRATOR I10/1/2023
1149606076AssignedPerson CCHANGE OWNER10/1/2023
1156544940COMPLETEDPerson ACHANGE ADMINISTRATOR I9/1/2023
1125905697COMPLETEDPerson BCHANGE ADMINISTRATOR I9/1/2023

 

When I filter, then remove duplicates (on subjectid, status, assigneerole, and createdon), I get the results I want, but I'm not able to remove the filters (As I can in Excel). How can I remove duplicates based on these conditions? -OR- is there a way to combine the 3 duplicates into 1 row and preserve all the other data as desired? 

 

Note: The table has many more columns and rows than above; this is just representative for this problem.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dodonald ,

 

I suggest you to try code as below to do some data transformation on your table.

= Table.Group(#"Changed Type", {"subjectid", "status", "assigneerole", "createdon"}, {{"assignee_userid", each Text.Combine([assignee_userid]," / "), type nullable text}})

Result is as below.

vrzhoumsft_0-1697181882768.png

You can download the attachment file to learn more details.

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @dodonald ,

 

I suggest you to try code as below to do some data transformation on your table.

= Table.Group(#"Changed Type", {"subjectid", "status", "assigneerole", "createdon"}, {{"assignee_userid", each Text.Combine([assignee_userid]," / "), type nullable text}})

Result is as below.

vrzhoumsft_0-1697181882768.png

You can download the attachment file to learn more details.

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors