Forum Discussion
Generating a filter to remove duplicates
- 2 years ago
Anonymous , You can try this in Power query
Select the table you want to work with.
Select the columns Appeared, Disappeared, and Component.
Go to the "Add Column" tab and click on "Merge Columns".
Choose a separator (e.g., a comma) and provide a name for the new column (e.g., Key).
Remove Duplicates:With the new Key column selected, go to the "Home" tab.
Click on "Remove Rows" and then select "Remove Duplicates".
Create a Function to Automate the Process:Go to the "Home" tab and click on "Advanced Editor".
Write a function that will combine the columns and remove duplicates. Here is an example of what the function might look like:let
Source = (inputTable as table) as table =>
let
// Combine columns to create a key
AddKeyColumn = Table.AddColumn(inputTable, "Key", each Text.Combine({Text.From([Appeared]), Text.From([Disappeared]), Text.From([Component])}, ",")),
// Remove duplicates based on the key
RemoveDuplicates = Table.Distinct(AddKeyColumn, {"Key"})Apply the Function:
Apply this function to your data source. You can do this by invoking the function on your table.
Anonymous , You can try this in Power query
Select the table you want to work with.
Select the columns Appeared, Disappeared, and Component.
Go to the "Add Column" tab and click on "Merge Columns".
Choose a separator (e.g., a comma) and provide a name for the new column (e.g., Key).
Remove Duplicates:
With the new Key column selected, go to the "Home" tab.
Click on "Remove Rows" and then select "Remove Duplicates".
Create a Function to Automate the Process:
Go to the "Home" tab and click on "Advanced Editor".
Write a function that will combine the columns and remove duplicates. Here is an example of what the function might look like:
let
Source = (inputTable as table) as table =>
let
// Combine columns to create a key
AddKeyColumn = Table.AddColumn(inputTable, "Key", each Text.Combine({Text.From([Appeared]), Text.From([Disappeared]), Text.From([Component])}, ",")),
// Remove duplicates based on the key
RemoveDuplicates = Table.Distinct(AddKeyColumn, {"Key"})
Apply the Function:
Apply this function to your data source. You can do this by invoking the function on your table.