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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply

Label the order ids as first, second, third, forth, and last order according to the pickup date

Hi Power Bi Family,

I have this visual that shows the name of the customer on the left table and all of his orders on the right table sorted by the pickup date. I would like to create show the sequence of orders like first, second, third, ...... and Last instead of the order id (Zc876, ru505, xr253 .... )

Screenshot 2022-05-30 162344.png

 

My end goal is to essentially create a bar chart that would tell me which order (first, second, third, fourth, .... last) has the most number of unique items of all customers. 


1 ACCEPTED SOLUTION

The formula I used worked perfectly according to what I was trying to achieve is: 

Order Rank =
VAR Customer = item_kpis[customer_id]
RETURN
    RANKX (
        FILTER ( item_kpis, item_kpis[customer_id] = Customer ),
        item_kpis[pickup_date],
        ,
        ASC,
        DENSE
    )

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Andrew_na_lang ,

You can create a column Rank

Rank =  rankx(filter(Table, [Full_name] = earlier([Full_name]) ), [Date],,asc,dense)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

The formula I used worked perfectly according to what I was trying to achieve is: 

Order Rank =
VAR Customer = item_kpis[customer_id]
RETURN
    RANKX (
        FILTER ( item_kpis, item_kpis[customer_id] = Customer ),
        item_kpis[pickup_date],
        ,
        ASC,
        DENSE
    )

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.