Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi Everyone!
I have a table like the one below with IDs that correspond to a specific person and dates of observation. I am wondering how to create the Timepoint column in bold below. I want to label the first, second, third, etc observation for each person based on the date field. Any ideas?
| ID | Date | Timepoint |
| 123 | 1/1/2023 | 2 |
| 546 | 2/3/2023 | 1 |
| 876 | 12/13/2022 | 1 |
| 123 | 5/8/2021 | 1 |
| 876 | 6/1/2023 | 2 |
Solved! Go to Solution.
hi, @eHorizons
let
Source = table_like_the_one_below,
gr = Table.Group(
Source, "ID",
{{"points", each Table.AddIndexColumn(Table.Sort(_, "Date"), "Timepoint", 1, 1)}}
),
expand = Table.ExpandTableColumn(gr, "points", {"Date", "Timepoint"})
in
expand
@eHorizons You can create the Timepoint column in Power Query.
If you want to label the observations in reverse order (i.e., the most recent observation labeled as 1), you can sort the table by ID and Date in descending order before performing the Group By operation.
NOTE: You can also archive the same result using a DAX Measure:
Timepoint = RANKX(FILTER(ALL('Table'), 'Table'[ID] = EARLIER('Table'[ID]) && 'Table'[Date] <= EARLIER('Table'[Date])), 'Table'[Date], , ASC)
hi, @eHorizons
let
Source = table_like_the_one_below,
gr = Table.Group(
Source, "ID",
{{"points", each Table.AddIndexColumn(Table.Sort(_, "Date"), "Timepoint", 1, 1)}}
),
expand = Table.ExpandTableColumn(gr, "points", {"Date", "Timepoint"})
in
expand