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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Pingouin_Puni
Frequent Visitor

Remove duplicate value but keep all the reste of the row

Hi all,

 

I'm trying to remove certain duplicates in specific a column but keep all the rows. I'm working on a calculated table and the second red rectangle is what I want to achieve:Sans titre.png

The 1st column contains IDs.

 

I hope for the red result if the IDs AND the values the green rectangle are duplicates. For the future: I might have more than 2 ID and green rectangle values as duplicates.

If it helps, the removing can be based on the penultimate colomn, which is a date. The problem is that those dates can be duplicates too...

 

Do you think it's possible through DAX?

 

Regards,

 

Pingouin Puni

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Pingouin_Puni 

 

This should give you the desired result.

Column = 
VAR __firstDate = 
    CALCULATE( 
        MIN( 'Table'[penultimate] ), 
        ALLEXCEPT( 'Table', 'Table'[Mission en cours_3.2] ) 
    ) 
RETURN 
IF( 'Table'[penultimate] = __firstDate, 'Table'[Dispo par mission] )

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi @Mariusz ,

 

Thank you for answering !

 

Your solution worked, but not as I intended to. I realized I didn't give the whole picture so I'll try to give as much info as I can through the attached .pbix and the following :

 

The formula for "Test" is this one :

Test = 
IF(
    Test[Nb of ID]>1;
    IF(
        Test[State of the mission]=Test[Mission_Test (groupes)];
        Test[Avaliability];
        BLANK()
    );
    Test[Avaliability]
)

For a duplicate ID :

  1. If there is 1 "Ongoing" status of the mission, in the "Test" column I need to have value of "Availability" the cell.
  2. If there are several "Ongoing", I need to keep them as well in the cell. (in green, all the column used in this case);Sans titre2.png
  3. If the state of the mission is not "Ongoing", in the "Test' column I need to have the value of "Availability" that is in the earliest "Stat" date column. And still keep the row (as presented in the red rectangle).

Sans titre.png

 

I hope I explained it clearly this time, let me know if I didn't 🙂

 

Regards,

 

Pingouin Puni

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors