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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
KH_Mike
Helper III
Helper III

Identify the oldest record

Hi All,

 

I have a set of data like this. For the ID, they have duplication under different "Record Date". What I want to do is to create a new column to check if the "ID" have duplication, it will show "Y" for the oldest record and "N" for the remaining. For the "ID" without duplication, it will always show "Y". Thank you.

 

 

IDRecord DateExpected Result
A2022-06Y
A2022-07N
A2022-08N
B2022-07Y
C2022-06Y
D2022-06Y
B2022-08N

 

1 ACCEPTED SOLUTION
PVO3
Impactful Individual
Impactful Individual

Hello,

 

Try this

Column =
VAR _0 = 'Table'[ID]
VAR _1 = CALCULATE(MIN('Table'[Record Date]), FILTER('Table',('Table'[ID] = _0)))
RETURN
IF(
    'Table'[Record Date] = _1,
    "Y",
    "N"
)

View solution in original post

1 REPLY 1
PVO3
Impactful Individual
Impactful Individual

Hello,

 

Try this

Column =
VAR _0 = 'Table'[ID]
VAR _1 = CALCULATE(MIN('Table'[Record Date]), FILTER('Table',('Table'[ID] = _0)))
RETURN
IF(
    'Table'[Record Date] = _1,
    "Y",
    "N"
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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