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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Blizzard
Regular Visitor

How to count duplicate values only once in a column

Hi all,

 

I want to identify in a column (not as a measure) all values for a specific ID only once. 

 

IDDateUnique
1009.11.2017YES
201.12.2017YES
1011.11.2011NO

 

The respective formular in Excel works fine as follows:

 

=IF(MATCH(A4,A:A,0)=ROW(),"YES","NO")

 

What I wanted to do is, that the last entry of an ID is identified as unique (column C) and all past values of the same ID should be marked as "no". Therefore the DISTINCTCOUNT formular with filter is not working. In that case, all double values would be counted > 1. For ID 10 the outcoume would be 2 for both rows but I want to count ID excatly one time as unique.

 

I dont want to delete duplicate rows.

 

Does anyone has an idea how to solve that problem?

 

Regards

Michael

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Blizzard

 

Hi, try with this calculated column

 

Unique =
IF (
    CALCULATE (
        MAX ( Table1[Date] );
        FILTER ( Table1; Table1[ID] = EARLIER ( Table1[ID] ) )
    )
        = Table1[Date];
    "Yes";
    "No"
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@Blizzard

 

Hi, try with this calculated column

 

Unique =
IF (
    CALCULATE (
        MAX ( Table1[Date] );
        FILTER ( Table1; Table1[ID] = EARLIER ( Table1[ID] ) )
    )
        = Table1[Date];
    "Yes";
    "No"
)

Regards

 

Victor

Lima - Peru




Lima - Peru

@Vvelarde

 

Hi Victor,

 

your solution worked perfect. I had to change the initial idea from the latest to the earliest date, but that was easy with your solution!

 

Thanks a lot,

 

Michael

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.