Forum Discussion

timbourdois's avatar
timbourdois
Frequent Visitor
5 years ago
Solved

Conditional duplicate check

Hi all...

 

I'm trying to use a conditional column (or power query) to check for duplicate values in one column and validate they belong to the same product (match) in a second column).  I'm close, but I'm getting false positives. 

 

ChkDupe =
IF ( ('419-421Merge'[CountName] > 1) &&  ('419-421Merge'[Full Path Name] = '419-421Merge'[Full Path Name]),1,2)
 
Countname tells me I have a duplicate(s) in the [NAME] column.... I then want to further refine ensuring [FULL PATH NAME] is also a match... in the example below, RED do not meet the condition... GREEN do.
 

 

  • Hi, timbourdois 

     

    Based on your desciption, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may create a custom column in Power Query with the following codes.

    let name=[Name],pathname=[Full Path Name],
    tab=Table.SelectRows(#"Changed Type",each [Name]=name and[Full Path Name]=pathname)
    in 
    Table.RowCount(tab)

     

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, timbourdois 

     

    Based on your desciption, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may create a custom column in Power Query with the following codes.

    let name=[Name],pathname=[Full Path Name],
    tab=Table.SelectRows(#"Changed Type",each [Name]=name and[Full Path Name]=pathname)
    in 
    Table.RowCount(tab)

     

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • timbourdois's avatar
      timbourdois
      Frequent Visitor

      Hi v-alq-msft 

       

      Thanks for the reply... I'm testing this now (I was away on holiday).  Preliminarily, it would appear I'm getting a logical state (True/False) vs. a numerical status, but that actually works well for my need.  I'll keep you updated on my results (the query is processing and the table is huge!)...

       

      I'm also going to explore (earlier) as well, but it would seem this will suit my need for the time being... more to follow