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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors