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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
beimeidagongren
New Member

Rankx with if statement not working

I am trying to rank the people based on the total calls they are getting. 

I first created a total calls measure and then a rank measure. Finally i am trying to create a calculated column to show if the people's rank is top 30 or not. However, after using the if statement, some of the outputs are not correct.

beimeidagongren_0-1721846486082.png

here are the codes:

FE Rank =RANKX(ALLSELECTED('FE Territory'), [FE Total Calls],,DESC,Dense)
Top30 =IF('FE Territory'[FE Rank] <=30,"Top 30","Under 30")
2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @beimeidagongren 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Here is an example of the data

FETotal CallsRank

Adam

243
Brian302
Chris801
Drake124
Eric55

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.