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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MostVIP2023
Helper I
Helper I

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

 

 

1 ACCEPTED SOLUTION

@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!




View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @MostVIP2023 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

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 ,

 

Thank you.

 

 

you are welcome





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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors