Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
I have a data as below. I need help on removing the Duplicate row where the Status is I and the 'Loc" is International.
the catch here is there can be employees with same status and Loc but they will have only one row. I only need to remove employees who have a duplicate record with this condition.
In this below data I need to remove only 1002 and 1006 duplicate record and not the 1004. Any idea on acheiving this please..?
emp no | status | Loc |
1001 | A | State |
1002 | I | State |
1002 | I | International |
1004 | I | International |
1005 | A | State |
1006 | I | State |
1006 | I | International |
1008 | I | State |
Solved! Go to Solution.
let
Source = the first step/s that brings your table to Power Query
#"Added Conditional Column" = Table.AddColumn(#"Source", "Sorting", each if [Loc] = "International" then 1 else 0),
#"Sorted Rows" = Table.Sort(#"Added Conditional Column",{{"Sorting", Order.Ascending}}),
#"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"emp no"}),
#"Sorted Rows1" = Table.Sort(#"Removed Duplicates",{{"emp no", Order.Ascending}}),
#"Removed Columns" = Table.RemoveColumns(#"Sorted Rows1",{"Sorting"})
in
#"Removed Columns"
let
Source = the first step/s that brings your table to Power Query
#"Added Conditional Column" = Table.AddColumn(#"Source", "Sorting", each if [Loc] = "International" then 1 else 0),
#"Sorted Rows" = Table.Sort(#"Added Conditional Column",{{"Sorting", Order.Ascending}}),
#"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"emp no"}),
#"Sorted Rows1" = Table.Sort(#"Removed Duplicates",{{"emp no", Order.Ascending}}),
#"Removed Columns" = Table.RemoveColumns(#"Sorted Rows1",{"Sorting"})
in
#"Removed Columns"
@LP280388 in case of duplicated it will always be I on status on all the duplicates or can also be different combinations (AA / AI )?
In PowerQuery
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
67 | |
64 | |
57 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |