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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
timbourdois
Frequent Visitor

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.
 
image.png

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @timbourdois 

 

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

Table:

b1.png

 

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)

 

b2.png

 

Best Regards

Allan

 

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

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @timbourdois 

 

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

Table:

b1.png

 

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)

 

b2.png

 

Best Regards

Allan

 

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

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

Greg_Deckler
Super User
Super User

@timbourdois See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....

You need to be using EARLIER to filter the table for each row to those rows that include the same NAME and then compare the values between rows, again, using EARLIER.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.