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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Yon_Yamas
Regular Visitor

Last middle last date

Hi,
My data base is like this and i would like to had a column filled with "First" when this is the first "date_debut" of the same group of "id_membre" ; "Last" if this is the last "date_début" of the group with same "id_membre" and "Renew" for the other rows.
Ex:
id_membre | date_debut  | new_row

1                 |  01/07/1965 | First

1                 |  01/07/1970 | Renew

1                 |  01/07/1971 | Last

2                 |  01/07/1965 | First

2                 |  01/08/1965 | Renew

2                 |  01/08/1965 | Renew

2                 |  01/08/1965 | Renew

2                 |  01/07/1965 | Renew

2                 |  01/07/1965 | Last

3                 |  01/07/1965 | First

4                 |  01/07/1965 | First

4                 |  01/07/1965 | Last

....

Tx for your help

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Yon_Yamas ,

 

try to add a calculated column like:

column =
VAR _table = FILTER(data, data[id_membre]=EARLIER(data[id_membre]))
VAR _first = MINX(_table, data[date_debut])
VAR _last = MAXX(_table, data[date_debut])
RETURN
SWITCH([date_debut], _first, "First", _last, "Last", "Renew")

View solution in original post

2 REPLIES 2
Yon_Yamas
Regular Visitor

Thank you so much !

FreemanZ
Super User
Super User

hi @Yon_Yamas ,

 

try to add a calculated column like:

column =
VAR _table = FILTER(data, data[id_membre]=EARLIER(data[id_membre]))
VAR _first = MINX(_table, data[date_debut])
VAR _last = MAXX(_table, data[date_debut])
RETURN
SWITCH([date_debut], _first, "First", _last, "Last", "Renew")

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.