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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
mryoan04
Frequent Visitor

Sequencing column by group in other column

Hi, I'm new to PBI. I have below columns Invoice Number, Transaction Date, and Invoice Sequence. Based on the Invoice Number, there are 6 invoices, sequenced by the number and the transaction date. However, I want to return another column (Sequenced by Date Only) that invoices with same transaction date will be grouped and return the same sequence number. Please advise how to get this column?

 

Invoice NumberTransaction DateInvoice SequenceSequence by Date Only
A34577/31/202411
A34587/31/202421
A34598/1/202432
A34608/1/202442
A34618/2/202453
A34628/3/202464

 

Thank you!

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@mryoan04,

 

Try this calculated column:

 

Sequence by Date Only = 
RANK (
    DENSE,
    ALL ( 'Table'[Transaction Date] ),
    ORDERBY ( 'Table'[Transaction Date], ASC )
)

 

DataInsights_1-1722720339589.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@mryoan04,

 

Note the PARTITIONBY argument:

 

Sequence by Date and Type = 
RANK (
    DENSE,
    ALL ( 'Table2'[Type], 'Table2'[Transaction Date] ),
    ORDERBY ( 'Table2'[Transaction Date], ASC ),
    PARTITIONBY ( 'Table2'[Type] )
)

 

DataInsights_0-1722724810503.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
mryoan04
Frequent Visitor

Awesome! It works! Thanks so much!

mryoan04
Frequent Visitor

Hi, @DataInsights thanks for the answer!

 

It works with some extent. I think I got the idea now, but I forgot to add one more parameter to the table to become the filter, which is column "Type". See below table. How to reset every sequence with the filter of column type?

 

TypeInvoice NumberTransaction DateInvoice SequenceSequence by Date
AA34577/31/202411
AA34587/31/202421
AA34598/1/202432
AA34608/1/202442
AA34618/2/202453
AA34628/3/202464
BA35517/31/202411
BA35527/31/202421
BA35538/1/202432

 

@mryoan04,

 

Note the PARTITIONBY argument:

 

Sequence by Date and Type = 
RANK (
    DENSE,
    ALL ( 'Table2'[Type], 'Table2'[Transaction Date] ),
    ORDERBY ( 'Table2'[Transaction Date], ASC ),
    PARTITIONBY ( 'Table2'[Type] )
)

 

DataInsights_0-1722724810503.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DataInsights
Super User
Super User

@mryoan04,

 

Try this calculated column:

 

Sequence by Date Only = 
RANK (
    DENSE,
    ALL ( 'Table'[Transaction Date] ),
    ORDERBY ( 'Table'[Transaction Date], ASC )
)

 

DataInsights_1-1722720339589.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.