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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How can I identify duplicates in a filtered column?

Hi
I'm looking for some help with identifying rows as duplicates ONLY if they are duplicated in the current filter context.

I'm having a really hard time doing this.
I can easily mark a duplicate row by creating a custom column by itterating through the table then adding a Yes/No or 1/0 but that only works in the context of the whole dataset when using a custom column.

E.g. whole dataset might look like

DateID
2020-01-01A
2020-01-01B
2020-01-02C
2020-01-03A

 

In my report visual I just pin a simple table containing both columns and a Date slicer against the date. 

If my slicer date range is the entire table then I need ID=A marked as duplicate.
If my slicer date range is only for the first 2 dates (2020-01-01 -> 2020-01-02) then there are no duplicates.

Any help would be great!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Try using ADDCOLUMNS to COUNTROWS against a SUMMARIZE



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Try using ADDCOLUMNS to COUNTROWS against a SUMMARIZE



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for pointing me in the right direction.

I ended up using that to create a new table with ID and number of duplicates. Initially it was just showing the whole table regardless of my date slicer then I reasised the slicer was using the date from the other table.... so I created a master calendar table and use that as the date slicer instead so it now affects both my DAX calculated table and the original.

 

Basically I created a table using this:

Table = 
        ADDCOLUMNS(
            SUMMARIZE(Sheet1,Sheet1[ID], Sheet1[Date]),
            "Duplicate",calculate(COUNTROWS(Sheet1))
        )

Then a master calendar table using CALENDARAUTO() and creating a relationship between the date in the master calendar and Sheet1 & Table.

I also created another bridging table for [ID] so I can now also drill through from my newly created table using [ID] to 'Sheet1'.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.