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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nhutruong
Regular Visitor

How to add a column with sequence ranking the appearance of a cell?

Hi All,

 

I know the way I way I phrase the question is very weird but I do not know how to describe what I need, so below is an example of what I have.

 

Issue :

 

The below is a column I have

Product CodeEvent Time
A1/1/2022
B1/1/2022
C1/1/2022
A2/1/2022
B2/1/2022
C2/1/2022
A3/1/2022
B3/1/2022
C3/1/2022

 

I need to add a column to specify the sequence of the moves according to event time for each product code.

I would need something looks like this:

 

Product CodeEvent TimeSequence
A1/1/20221
B1/1/20221
C1/1/20221
A2/1/20222
B2/1/20222
C2/1/20222
A3/1/20223
B3/1/20223
C3/1/20223

 

I think I need to use the summarize function but I am unfortunately not proficient enough to make out the formula on my own,

I would appreciate any help.

 

Thank you so much.

 

Regards.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1679459762101.png

 

 

Sequence CC =
COUNTROWS (
    WINDOW (
        1,
        ABS,
        0,
        REL,
        SUMMARIZE ( ALL ( Data ), Data[Product Code], Data[Event Time] ),
        ORDERBY ( Data[Event Time], ASC ),
        KEEP,
        PARTITIONBY ( Data[Product Code] )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1679459762101.png

 

 

Sequence CC =
COUNTROWS (
    WINDOW (
        1,
        ABS,
        0,
        REL,
        SUMMARIZE ( ALL ( Data ), Data[Product Code], Data[Event Time] ),
        ORDERBY ( Data[Event Time], ASC ),
        KEEP,
        PARTITIONBY ( Data[Product Code] )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


OMG, thank you so much for your fast response.

Worked like a charm.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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