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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
gancw1
Resolver II
Resolver II

How to filter off 'duplicate' records

I have a table of quiz submissions as show below and I need to discard the student records with Incomplete status (#5) if there is already a record with Submitted status (#4)

gancw1_0-1664438239994.png

How can I do this in Power Query ?

1 ACCEPTED SOLUTION
SolomonovAnton
Super User
Super User

Hello ! 

 

you need create in Power Query table with name "Result_Table" and List with name "Submited_list"
code for its items bellow.

table with name "Base_Table" - it is your table from topic start

Submited_list

 

 

let
    Source = Base_Table,
    #"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "Submited")),
    Custom1 = #"Filtered Rows"[Name]
in
    Custom1

 

 

 
Result_Table

 

 

let
    Source = Base_Table,
    #"Added Custom1" = Table.AddColumn(Source, "Completed_List", each List.Contains(Submited_list, [Name])),
    #"Added Conditional Column" = Table.AddColumn(#"Added Custom1", "check", each if [Completed_List] = true and [Status]<>"Submited" then 0 else 1),
    #"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([check] = 1)),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"SN", "Name", "Status"})
in
    #"Removed Other Columns"

 

 

I hope it will help you 🙂

Best Regards !

 

View solution in original post

3 REPLIES 3
SolomonovAnton
Super User
Super User

If I answered at your question please mark topic as resolved 🙂

SolomonovAnton
Super User
Super User

Hello ! 

 

you need create in Power Query table with name "Result_Table" and List with name "Submited_list"
code for its items bellow.

table with name "Base_Table" - it is your table from topic start

Submited_list

 

 

let
    Source = Base_Table,
    #"Filtered Rows" = Table.SelectRows(Source, each ([Status] = "Submited")),
    Custom1 = #"Filtered Rows"[Name]
in
    Custom1

 

 

 
Result_Table

 

 

let
    Source = Base_Table,
    #"Added Custom1" = Table.AddColumn(Source, "Completed_List", each List.Contains(Submited_list, [Name])),
    #"Added Conditional Column" = Table.AddColumn(#"Added Custom1", "check", each if [Completed_List] = true and [Status]<>"Submited" then 0 else 1),
    #"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([check] = 1)),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"SN", "Name", "Status"})
in
    #"Removed Other Columns"

 

 

I hope it will help you 🙂

Best Regards !

 

@SolomonovAnton ,

Thanks for the solution.  The List.Contains( ) is the look up function that I was looking for !

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.