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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

RankX with filter and earlier functions but sorte ascending

I´m developing an analysis tht will allow me to identify a production sequency based on times.

I aready have a formula that works, with the correct fields and filters, but when I try to force rank to be sorted ascending the formula lose the filter.

 

Original:

 

RANKX(filter('PRODUCTION ORDERS';'PRODUCTION ORDERS'[Sequence_key]=EARLIER('PRODUCTION ORDERS'[Sequence_key]));'PRODUCTION ORDERS'[Sequence_S1];;)

 

When I force ascending:

RANKX(filter('PRODUCTION ORDERS';'PRODUCTION ORDERS'[Sequence_key]=EARLIER('PRODUCTION ORDERS'[Sequence_key]));'PRODUCTION ORDERS'[Sequence_S1];;1) it lose the ranking tby subcategory sequence_key.

 

Thank you so much,

Cheers,

Fátima

 

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Please check the formula as below. If it doesn't meet your requirement, kindly share your sample data to me.

 

RANKX(CALCULATETABLE('PRODUCTION ORDERS',filter('PRODUCTION ORDERS';'PRODUCTION ORDERS'[Sequence_key]=EARLIER('PRODUCTION ORDERS'[Sequence_key])));'PRODUCTION ORDERS'[Sequence_S1];;1)

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi there,

Thank you very much, but with your formula I lose the filter, so what it does is a kind of overall ranking instead of a ranking by category.

 

As you can see below, teste is the field that I get with your formula, Sequence_S1 is my oriinal formula, so I know for sequence_key 3910L01 I have 36 lines and they are correctly descending sorted, but I need them ascendling sorted.

 

If you see for the next category Sequence_key=4010L1 I have 36 lines... So the subranking by category are working, only the sort is failing.

 

Thank you very much for your support.

Fátima

My data is this:FatimaBIError.JPG

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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