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
mb0307
Responsive Resident
Responsive Resident

Ranking - negative or positive

Hi all,

 

As shown in the example below, I would like to rank the companies by sales variance.  Result should show Top 5 ranking by biggest variance number regardless if it is a -ve or +ve number.

 

Capture.PNG

 

Thanks in advance.

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

@mb0307 

Use the ABS function to render all values positive and then use that in the RANKX measure. (Or new column)

This blog post may help (if you wish to display the actual rank):

Reversing the Y-Axis for ranks 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

Rankx(all(Table[compnay]), calculate(abs(sum(table[sales variance]))),,asc,dense)

 

by adding ABS function it gives the desired output. 

 

Thanks

View solution in original post

4 REPLIES 4
FrankAT
Community Champion
Community Champion

Hi @mb0307 

what about this solution?

 

25-08-_2020_23-27-02.png

 

Rank = RANKX(ALL('Table'),[Sum of Sales Variance],,DESC)

 

Regards FrankAT

PaulDBrown
Community Champion
Community Champion

@mb0307 

Use the ABS function to render all values positive and then use that in the RANKX measure. (Or new column)

This blog post may help (if you wish to display the actual rank):

Reversing the Y-Axis for ranks 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Rankx(all(Table[compnay]), calculate(abs(sum(table[sales variance]))),,asc,dense)

 

by adding ABS function it gives the desired output. 

 

Thanks

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.