Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |