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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors