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
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
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.