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 dateJoin 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.
Hi All,
Hoping you can help.
I am trying to remove rows from a file where there is a duplicate Product ID, but I wish to remove the row that contains a 'Sales' amount of the lesser value.
Any suggestions would be greatly appreciated
Please see snip below
Cheers!
Solved! Go to Solution.
Hi , @Shannyn
Based on your description, you want to keep the record of the largest [Sales] of the duplicate [Product_ID].Right?
It will be easier in Power Query Editor, Here are the steps you can refer to :
(1)This is my test data :
(2)We can click "Insert Step After" to create a step in the query and enter M language:
= Table.Group(#"Changed Type" , "Product_ID" , {"test",(x)=> Table.Sort(x,{"Sales",1}){0} } )
The #"Changed Type" is your last step name.The result is as follows:
(3)Then we can expand the "Record" and we will meet your need:
The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
Share some data to work with and show the expected result.
Hi , @Shannyn
Based on your description, you want to keep the record of the largest [Sales] of the duplicate [Product_ID].Right?
It will be easier in Power Query Editor, Here are the steps you can refer to :
(1)This is my test data :
(2)We can click "Insert Step After" to create a step in the query and enter M language:
= Table.Group(#"Changed Type" , "Product_ID" , {"test",(x)=> Table.Sort(x,{"Sales",1}){0} } )
The #"Changed Type" is your last step name.The result is as follows:
(3)Then we can expand the "Record" and we will meet your need:
The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Shannyn , I think you can manage that in a measure
sumx(Values(Table[Product]), calculate(Max(Table[Value])) )
or create a flag measure
if([Value] = maxx(filter(Table, [Product] =earlier([Product]) ), [Value],1,0)
filter for 1
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
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 |
---|---|
61 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
85 | |
60 | |
45 | |
41 | |
39 |