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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Add a sequence number by ID and date/time

I have a table with an alphanumeric ID field and a modified date & time field. I need another column that assigns a sequence numer by ID and date/time. 

 

So this:

IDModified Date
INC0000019148628/9/2017 16:27
INC0000019148628/9/2017 18:04
INC0000019148628/9/2017 20:22
INC0000019148628/9/2017 22:39
INC0000019148628/10/2017 15:21
INC0000019167688/12/2017 16:07
INC0000019167688/12/2017 16:25
INC0000019167688/12/2017 16:27
INC0000019167688/12/2017 16:32
INC0000019167688/12/2017 18:37

 

Needs to return this:

IDModified DateSequence
INC0000019148628/9/2017 16:271
INC0000019148628/9/2017 18:042
INC0000019148628/9/2017 20:223
INC0000019148628/9/2017 22:394
INC0000019148628/10/2017 15:215
INC0000019167688/12/2017 16:071
INC0000019167688/12/2017 16:252
INC0000019167688/12/2017 16:273
INC0000019167688/12/2017 16:324
INC0000019167688/12/2017 18:375

 

Thoughts?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Can add this as a calculated column:

Sequence = 
VAR CurrentID= Table1[ID]
VAR CurrentDate = Table1[Modified Date]
RETURN

CALCULATE(
    COUNTROWS( Table1 ),
    FILTER ( 
        ALL( Table1 ),
        CurrentID = Table1[ID]
        && CurrentDate >= Table1[Modified Date]
    )
)

Count using Var.png

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Can add this as a calculated column:

Sequence = 
VAR CurrentID= Table1[ID]
VAR CurrentDate = Table1[Modified Date]
RETURN

CALCULATE(
    COUNTROWS( Table1 ),
    FILTER ( 
        ALL( Table1 ),
        CurrentID = Table1[ID]
        && CurrentDate >= Table1[Modified Date]
    )
)

Count using Var.png

 

 

Anonymous
Not applicable

@Anonymous  is there a way to allow duplicate numbers in the sequence? I have a table with multiple rows for the same ID and date and want these to have the same sequence value.

 

Thanks

Anonymous
Not applicable

Works perfect, thanks!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.