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
Godasa
Frequent Visitor

How to finding duplicates in rows for the selected time period

I have difficulties with finding duplicates in rows for the selected time period. Could you please help to solve this out.

1.   I need to find duplicated rows in a table which has the same Inventory Nr, Address and Weight. So first of all I do CONCATENATE function for 3 columns. As a result I have to show only those records which repeats in the selected period, for ex. from March 1st until March 31st.

According to my calculation I see too many lines, because it finds duplicates in the other periods as well. It should be only marked records.

 
 

2.  In a separate cards I have to show duplicated rows and distinct rows.

Thank you in advance!

1 ACCEPTED SOLUTION

Hi @Godasa,

You can enable 'conditional formatting' -> 'font color' formatted by 'field value' with below measure formula to hight light duplicate rows:

Measure =
VAR selected =
    ALLSELECTED ( Calendar[Date] )
VAR rowcount =
    CALCULATE (
        COUNTROWS ( table[CONCATENATE] ),
        FILTER ( ALLSELECTED ( table ), [Date] IN selected ),
        VALUES ( table[CONCATENATE] )
    )
RETURN
    IF ( rowcount > 1, "Yellow", "Black" )

Use conditional formatting in tables 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Godasa , Assume for a" key" column you want fine what is the count of keys have to duplicate you can do like

countx(filter(summarize(table, table[Key], "_1", distinctcount(Table[Key]),"_2",count(Table[Key])),[_1]<>[_2]),[Key])

Hi @amitchandak , 

I'm trying to understand your solution, but please explain, what table[Key] means? 

I understand that after CONCATENATE function I have to create column as "Index" (or "Key"). How this "Key" column should be written? When i have "key"column I can use your provided formula. I'm I right?  

My data looks like this:

duplicate.jpg  

Thank you 🙂

Hi @Godasa,

You can enable 'conditional formatting' -> 'font color' formatted by 'field value' with below measure formula to hight light duplicate rows:

Measure =
VAR selected =
    ALLSELECTED ( Calendar[Date] )
VAR rowcount =
    CALCULATE (
        COUNTROWS ( table[CONCATENATE] ),
        FILTER ( ALLSELECTED ( table ), [Date] IN selected ),
        VALUES ( table[CONCATENATE] )
    )
RETURN
    IF ( rowcount > 1, "Yellow", "Black" )

Use conditional formatting in tables 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you @v-shex-msft for the formula and explanation.  I tried a little bit easier way of solution, which seams to be working. My formula looks like this: 

Measure = CALCULATE(COUNT(Table[Concatenate]);ALLEXCEPT(Table;Table[Date];Table[Concatenate]))
In a filter pane I add filter: Measure is greater or equal to 2. 
 
 
 

 

az38
Community Champion
Community Champion

Hi @Godasa 

you've done almost all you need.

create a table visual and put your CONCATENATE field twice into it

then for second field set aggregation as Count and you will find all duplicate rows


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.