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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bnjmnnl
Helper I
Helper I

Rank duplicate ID based on date

Good day! Im facing a small issue but would help a lot when solved. My dataset shows the following:

JobPU Date
101/01/23
101/02/23
101/03/23
201/01/23
301/01/23
3

01/02/23

 

However I need a new column (in query editor) to rank them like the following:

JobPU Date Step
101/01/23 1
101/02/23 2
101/03/23 3
201/01/23 1
301/01/23 1
301/02/23 2



Would help me out a lot if someone has the solution for me! Table is called 'Jobs Ranked'
Thank you!

1 ACCEPTED SOLUTION

Hi @bnjmnnl  for ranking with POWER QUERY please refer to the linked tutorial

https://www.youtube.com/watch?v=ej60Wxaum_E

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi @bnjmnnl 

Add a calculated column with the dax code :

Ranking =
RANKX(
    FILTER(
        ALL('Table (2)'),
        'Table (2)'[Job] = EARLIER('Table (2)'[Job])
    ),
    'Table (2)'[PU Date],
    ,
    ASC
)
Ritaf1983_0-1700813781265.png

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hello! Thank you but this is not the option I'm looking for. This works for table view in the report but wom't show the data in query editor. I need to have it in Query editor to go further with new steps. Do you know how to achieve this?

 

Hi @bnjmnnl  for ranking with POWER QUERY please refer to the linked tutorial

https://www.youtube.com/watch?v=ej60Wxaum_E

If this post helps, then please consider Accepting it as the solution to help the other

members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you!

Glad to help😊

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

And I'm going to add a followup question haha, maybe you can help me again. 

Thanks to your help, my data is like the following:

JobStepPU DatePU At
1101/01/23a
1201/02/23b
1301/03/23c
2101/01/23a
3101/01/23a
3201/02/23b

 

However, now I want to add them in new columns. Like the following:

JobStep 1PU Date 1PU At 1Step 2PU Date 2PU At 2Step 3PU Date 3PU At 3Step 4PU Date 4PU At 4
1101/01/23a201/02/23b301/03/23c4nullnull
2101/01/23a2nullnull3nullnull4nullnull
3101/01/23a201/02/23b3nullnull4nullnull



As you see, no job has a 4th step. The jobs can have a maximum of 10 steps, so I will need to make the new columns for 10 steps, they ma all show blank when they are not used. 

Do you know a way to achieve this? Thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.