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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Looking to extract start year and end year from below table

Hi Guys,
I hope you all are doing well.

I had a quick question about the start and end date - It may be the simple one, But I can't find the solution.

 

I had a table with names and dates as follows below.

NamesYears
David2018
David2019
David2020
Peter2019
Peter2020
Alex2020
Alex2021
Alex2022

 

From the above table, I want to extract only the start year and end year


Output needs to look like

NamesStart YearEnd Year
David20182020
Peter20192020
Alex2020

2022

 

Any help can be appreciated - Thanks, and looking forward to the solution.

3 REPLIES 3
VahidDM
Super User
Super User

HI @Anonymous 

 

If you need a new table, then use this code to create a table:

New Table = 
SUMMARIZE (
    'Table',
    'Table'[Names],
    "Start Year", MIN ( 'Table'[Years] ),
    "End Year", MAX ( 'Table'[Years] )
)

 

File with all solutions attached.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new table.

 

Picture1.png

 

New Table =
ADDCOLUMNS (
VALUES ( Data[Names] ),
"@STartYear", CALCULATE ( MIN ( Data[Years] ) ),
"@EndYear", CALCULATE ( MAX ( Data[Years] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
VahidDM
Super User
Super User

Hi @Anonymous 

 

You can use below measures:

 

Start Year = MIN (Table[Years])

End Year = MAX (Table[Years])

then create a table and add Names, Start Year, and End Year to the table.

 

On the other hand, without measures, you can add Years column to the table with Min and Max aggregation.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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