Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Extract Table from another Table based on a date criteria

Hey Gurus,

 

 

I have the following table and I would like to extract Distinct Names and the oldest date coreesponding to this date:

 

NameDate
Adam1/1/2002
Adam14/5/2006
Adam12/12/2022
John1/7/1900
John1/1/2025

 

Result should be:

 

Adam 1/1/2002

John 1/7/1900

 

Any ideas?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous,

    I'd like to suggest you use the name field as category to create a table visual, then you can write a measure formula to find out the first date based on current name group:

     

    formula =
    CALCULATE ( Min( Table[Date] ), ALLSELECTED ( Table ), VALUES ( Table[Name] ) )

     

    If you mean to create a new table with correspond results, you can ty use the following formula if it helps:

     

    NewTable =
    SUMMARIZE ( Table, Table[Name], "Oldest Date", MIN ( Table[Date] ) )

     

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    I'd like to suggest you use the name field as category to create a table visual, then you can write a measure formula to find out the first date based on current name group:

     

    formula =
    CALCULATE ( Min( Table[Date] ), ALLSELECTED ( Table ), VALUES ( Table[Name] ) )

     

    If you mean to create a new table with correspond results, you can ty use the following formula if it helps:

     

    NewTable =
    SUMMARIZE ( Table, Table[Name], "Oldest Date", MIN ( Table[Date] ) )

     

    Regards,

    Xiaoxin Sheng