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
Bashir_Nadaf
Helper I
Helper I

How to rank columns by cost

Hi all 

 

I am trying to get the rank by cost

instead of getting rank i am getting count of item no. 

 

2022-06-05 (2).png

 

Appreciate if any help!

20 REPLIES 20
chrisyan_manalu
Helper II
Helper II

@Bashir_Nadaf ,

 

Please try  =
RANKX ( ALLSELECTED ( tblUsageReportingData[ItemNo] ), [Total Cost UA], ,ASC,Dense))

@chrisyan_manalu 
this is not working 
this measure is doubled the rank column

Hi @Bashir_Nadaf 

This error involves costAmount(Actual) and Total Cost UA, and we need to look at their code. If the code involves multiple tables, please share both the multiple tables and the table structure, we just need to know which fields are involved in the table.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

I mean ranking itself is a measure?

Yes @tamerj1 

ranking is a measure

@Bashir_Nadaf 
Sorry, I Have no idea why it is returning the count instead of the rank!

ok 
thank you so much for trying @tamerj1 

@Bashir_Nadaf 

Are you using other filters or slicers?

@tamerj1 

No not using any filters or slicers

@Bashir_Nadaf 

Are you using other filters or slicers?

tamerj1
Super User
Super User

Hi @Bashir_Nadaf 

please try

Rank column =
RANKX ( ALLSELECTED ( tblUsageReportingData[ItemNo] ), [Total Cost UA] )

This is not working 

showing the same result

if i take the rank column as sum it is showing the rank as shown in above image

and if i select dont summarize it is showing 1 in rank column for all the rows

Hi @Bashir_Nadaf 
Are you sure [Total Cost UA]  is the same measure used in the visual?

Yes 
total cost UA and cost amount(actual) are showing same data 

total cost UA is a measure and 

cost amount actual is a column

@Bashir_Nadaf 

please try remove the column from the visual and use the measure instead

Hi @tamerj1 

added the measure and removed the column still getting the same result

2022-06-05 (5).png

@Bashir_Nadaf 
If not sensitive data, can you share the file?

Sorry @tamerj1 

can't share..

@Bashir_Nadaf 
Please make sure you are creating a measure not a calculated column

@tamerj1 

item no is column

cost is a measure 

ranking through cost 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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