Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Remove Duplicates Based on Another Column Value

 

Guys, I need your support please, I need to remove duplicates selecting 4 columns based on 5th column value condicationally:

 

The current script carries out removing the duplications of 4 selected columns:

= Table.Distinct(#"Divided Column", {"HR ID", "Employee Name", "Exception Duration", "Date"})

 

Now, how to set this in condition if "Exception Type" = "Daily"

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Anonymous 

     

    You may check the steps in the pbix

     

     

    Best regards
    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Anonymous 

    Can you share/paste some sample data and show the expected output from Excel to correctly understand your question.?


    • Anonymous's avatar
      Anonymous
      Not applicable

      Current dataset (2nd image)

      Desired output (1st image)

       

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 

        Do the following steps:

        1. Duplicate your source query
        2. Filter on one with Exception Type = Daily
        3. Apply Remove Duplicates on the table

        4. On the other copy of the query, filter out daily
        5. Append as New query

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

     

    You may check the steps in the pbix

     

     

    Best regards
    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.