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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MostVIP2023
Frequent Visitor

Issue with Rankx in calculated column

Dear experts,

 

  When I use rankx in calculated column ,it returns 1 in all rows, would you pls advise me how to fix it?

MostVIP2023_0-1736816801290.png

 

 

5 REPLIES 5
ryan_mayu
Super User
Super User

what's the expected output?

 

is this what you want?

 

Column = RANKX('Table','Table'[金额],,DESC)
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ryan_mayu ,

 

Thanks for your quick reply, I need to rank group by the first column,Product.

 

 

@MostVIP2023 

then you can create measure 

 

Measure = sum('Table'[金额])
Measure 2 = rankx(ALLSELECTED('Table'[产品]),[Measure],,DESC)
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi  @ryan_mayu ,

 

I need to rank in calculated column.

 

 

@MostVIP2023 

then you can try this

 

Column =
var _sum=CALCULATE(sum('Table (2)'[金额]),ALLEXCEPT('Table (2)','Table (2)'[产品]))
var _tbl=SUMMARIZE('Table (2)','Table (2)'[产品],"total",sum('Table (2)'[金额]))
return COUNTROWS(FILTER(_tbl,[total]>=_sum))
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

December 2024

A Year in Review - December 2024

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