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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power Query date time serial number

Hello,

 

I have a table that looks like this.

IDDateTime
13-2-2020 08:00:38
13-2-2020 08:01:16
13-2-2020 08:01:23
23-2-2020 08:02:04
23-2-2020 08:04:43
33-2-2020 08:02:09
33-2-2020 08:02:11
33-2-2020 08:03:47
33-2-2020 08:04:36

 

I would like to add a column with increasing numbers per ID based on the date and time column. Below an example of the desired result.

 

IDDateTimeSerialnr
13-2-2020 08:00:381
13-2-2020 08:01:162
13-2-2020 08:01:233
23-2-2020 08:02:041
23-2-2020 08:04:432
33-2-2020 08:02:091
33-2-2020 08:02:112
33-2-2020 08:03:473
33-2-2020 08:04:364

 

Is this possible with the help of power query and can someone help me with the right code? @Greg_Deckler  @MattAllington 

Thanks in advance!!

 

Kind regards,

 

Tiemen

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can use Group By on ID, All Rows as Operation 
image.png

And later adjust the Grouped Rows Step to accommodate Index column.

= Table.Group(#"Changed Type", {"ID"}, {{"tbl", each Table.AddIndexColumn( _, "Serialnr", 1, 1 ) , type table [DateTime=datetime, Serialnr=number]}})

Please see the attached file for reference.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can use Group By on ID, All Rows as Operation 
image.png

And later adjust the Grouped Rows Step to accommodate Index column.

= Table.Group(#"Changed Type", {"ID"}, {{"tbl", each Table.AddIndexColumn( _, "Serialnr", 1, 1 ) , type table [DateTime=datetime, Serialnr=number]}})

Please see the attached file for reference.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Hi @Mariusz 

 

This works!! Thank you!! 🙂

 

Kind regards,

Tiemen

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors