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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zxl1031
Helper I
Helper I

How to create a rank column by date for rows with same key id

Hello,

 

I am looking to create a rank column based on sort by "created" column for rows with same key. 

I use this formula but with error : a circular dependency wa detected.

rank = RANKX(ALLEXCEPT[table,table[key]),table[created],,ASC)

 

Please help! Thanks so much!

keycreatedrank
CORE-112702/14/2018 10:211
CORE-112712/7/2018 13:551
CORE-112712/13/2018 12:052
CORE-112715/29/2018 15:203
CORE-112715/31/2018 15:144
CORE-112732/7/2018 13:571
CORE-112732/13/2018 12:052
CORE-112735/29/2018 15:003
CORE-112735/31/2018 14:244
CORE-112742/16/2018 16:555
CORE-112782/7/2018 14:011
CORE-112782/13/2018 12:042
CORE-125505/30/2018 11:451
CORE-125506/1/2018 16:012
CORE-125507/4/2018 17:303
CORE-125507/11/2018 15:194
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@zxl1031 try this to add as new column

 

rank1 = RANKX(FILTER(table1,Table1[key]=EARLIER(table1[key])),table1[created],,ASC)
 


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@zxl1031 try this to add as new column

 

rank1 = RANKX(FILTER(table1,Table1[key]=EARLIER(table1[key])),table1[created],,ASC)
 


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2kthanks! this works! Why ALLEXCEPT function is not working?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.