Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have a table with duplicates in column 'A' I want deleted. I want the duplicate with the lowest value in column 'B' to be deleted.
Any help would be greatly appreciated. Thanks
Solved! Go to Solution.
Hi @Lachlanpap, check this
Before
After
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyNDMztDQGMoyNLJRidaKVjEwgohbGxmCGuSlY2AwibG4EVKajZGRqZoYibGpgCBeOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"A", Int64.Type}, {"B", Int64.Type}, {"C", Int64.Type}}),
GroupedRows = Table.Group(ChangedType, {"A"}, {{"All", each if Table.RowCount(_) > 1 then Table.SelectRows(_, (x)=> x[B] <> List.Min([B])) else _, type table}}),
CombinedAll = Table.Combine(GroupedRows[All])
in
CombinedAll
You can do by using group by, by selecting two column then group by with min value.
Step 1.
Step 2.
You can do by using group by, by selecting two column then group by with min value.
Step 1.
Step 2.
Thanks for your help, both responses worked.
Hi @Lachlanpap, check this
Before
After
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRU0lEyNDMztDQGMoyNLJRidaKVjEwgohbGxmCGuSlY2AwibG4EVKajZGRqZoYibGpgCBeOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t, C = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"A", Int64.Type}, {"B", Int64.Type}, {"C", Int64.Type}}),
GroupedRows = Table.Group(ChangedType, {"A"}, {{"All", each if Table.RowCount(_) > 1 then Table.SelectRows(_, (x)=> x[B] <> List.Min([B])) else _, type table}}),
CombinedAll = Table.Combine(GroupedRows[All])
in
CombinedAll
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
13 | |
10 | |
8 | |
7 |
User | Count |
---|---|
17 | |
10 | |
7 | |
6 | |
6 |