Forum Discussion
nic2023
1 year agoFrequent Visitor
Remove duplicates based on conditions in Power Query
Hi everyone, I'm trying to remove some duplicates in a large list, which is formed from appending 2 lists of staff IDs. Some of the Staff IDs have duplicate entries, I'd like to set up some conditio...
- 1 year ago
Hi,
One of ways is using Table.Group function in Power Query Editor.
let Source = Data_Source, #"Grouped Rows" = Table.Group(Source, {"Staff ID"}, {{"End Date", each List.Max([End Date]), type nullable date}}) in #"Grouped Rows"
Jihwan_Kim
1 year agoSuper User
Hi,
Please try something like below whether it suits your requirement.
Please check the below picture and the attached pbix file.
It is for creating a new table.
expected result table =
VAR _list =
DISTINCT ( Data[Staff ID] )
VAR _t =
ADDCOLUMNS ( _list, "End Date", CALCULATE ( MAX ( Data[End Date] ) ) )
RETURN
_t
nic2023
1 year agoFrequent Visitor
Sorry I'm using Power Query in Excel.
- Jihwan_Kim1 year agoSuper User
Hi,
One of ways is using Table.Group function in Power Query Editor.
let Source = Data_Source, #"Grouped Rows" = Table.Group(Source, {"Staff ID"}, {{"End Date", each List.Max([End Date]), type nullable date}}) in #"Grouped Rows"