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
Fusilier
Helper III
Helper III

Help with RANKX in an existing measure

Hi,

I have this measure:

%SBC Count Agree = DIVIDE( SUM('Raw Data'[Agree]) , CALCULATE(SUM('Raw Data'[row count]),all('Raw Data'[Answers aggregated])))
It produces all Agree responses as a % of total answers for each question.
What I want to do is use it to create a rank of the result of the measure so if Q1 is highest at 23% and Q5 is second highest at 21% I get Q1 = 1, Q5 = 2 etc.
Is this possible. I've tried adding RANKX but can't ge it to work (not sure if it can work though)
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Fusilier - Yes, it is possible to use RANKX to rank the result of your %SBC Count Agree measure based.

 

create below calculation:

Rank Agree % =
RANKX(
ALL('Raw Data'[Question]), // Table over which to rank (all questions)
[%SBC Count Agree], // Expression to rank by (the percentage measure)
, // Leave empty for default
DESC, // Rank in descending order (highest percentage first)
DENSE // Use DENSE ranking to avoid gaps in ranks
)
 

you should be able to rank your questions by the percentage of "Agree" responses as you want.

Hope this helps.





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

Proud to be a Super User!





View solution in original post

3 REPLIES 3
rajendraongole1
Super User
Super User

Hi @Fusilier - Yes, it is possible to use RANKX to rank the result of your %SBC Count Agree measure based.

 

create below calculation:

Rank Agree % =
RANKX(
ALL('Raw Data'[Question]), // Table over which to rank (all questions)
[%SBC Count Agree], // Expression to rank by (the percentage measure)
, // Leave empty for default
DESC, // Rank in descending order (highest percentage first)
DENSE // Use DENSE ranking to avoid gaps in ranks
)
 

you should be able to rank your questions by the percentage of "Agree" responses as you want.

Hope this helps.





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

Proud to be a Super User!





Got it working!

Thank you very much for your help.

Thank you for your help.

I've tried the measure in a table but it's returning 1 for every line:

table.png

I'll have another look.

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
Top Kudoed Authors