cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Power Query date time serial number

Hi @Tiemen 

 

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
Highlighted
Super User IV
Super User IV

Re: Power Query date time serial number

Hi @Tiemen 

 

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

Highlighted
Helper II
Helper II

Re: Power Query date time serial number

Hi @Mariusz 

 

This works!! Thank you!! 🙂

 

Kind regards,

Tiemen

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (466)