Power query: Remove duplicate record based on criteria

Wishmaster89

Board Regular
Joined
Jan 10, 2022
Messages
77
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
Hi all

So I have some data in power query where their is a duplicate learner ID but some records also have a restart value of True. Where this is the case i want to keep the record which = True.

Please see sample data below, it is in excel as i don't want to post actual data from power query as its sensitive.

Book1
AB
1Learner IDRestart
21
31TRUE
42
52TRUE
63
73
Sheet1
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You'll probably want to do a Group By in the query editor, with your Learner ID being what to group by, and then setting your Restart column to Max. It will cause it to condense to one line per Learner ID.
 
Upvote 0
That deleted every column except the first one :/

Thanks for the suggestion though.
 
Upvote 0
Well, not knowing what all you have in your sheet aside from the two columns....you'll need to include the missing columns in the same piece of the group by as your Restart column, using Max for each.
 
Upvote 0
Can’t because theres other records that the true value doesn’t apply to.
 
Upvote 0

Forum statistics

Threads
1,223,669
Messages
6,173,700
Members
452,527
Latest member
ineedexcelhelptoday

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top