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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors