Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

remove duplicate based on specific value

I have data as shown belew 

 

idstagestatus
1acomplete
1bcomplete
1bnot complete
2acomplete
2bnot complete

 

I want to drop the duplicate rows based on stage and id columns but because they have different status and want to keep the one with "complete".

 

I have seen this measure but I don't know how to compare by stage too and how to make it keep specific value not the MIN

 

measure = 
SUMMARIZE(yourTablename, yourTablename[ID], "MinValue", MIN(yourTablename[status]) )

the result I expect 

 

idstagestatus
1acomplete
1bcomplete
2acomplete
2bnot complete

 

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

I've created this file as an example: Download PBIX 

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Please, if it worked mark this as a solution. So we can help other with the same question.

 

Thanks.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

thank you it worked but is there any way to apply it with measure

Hi @Anonymous ,

 

Yes,

 

try this code:

 

Measure =
VAR _qtdeStatus = CALCULATE(DISTINCTCOUNT('Table (2)'[status]); ALLEXCEPT('Table (2)'; 'Table (2)'[id]; 'Table (2)'[stage]))
RETURN IF(_qtdeStatus > 1; CALCULATE(DISTINCT('Table (2)'[status]); FILTER('Table (2)'; 'Table (2)'[status] = "Complete")); CALCULATE(DISTINCT('Table (2)'[status])))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

I've created this file as an example: Download PBIX 

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.