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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Rank function

Krutigawale33_0-1612178621971.png

I am using 

Rank = RANKX(FILTER(KPI_Reporting,IF(KPI_Reporting[condition(1/2)]="2",1)),[(DecActual-DecPlan)],,ASC)
its not working well
 
I need to find out rank of those rows with values only condition(1/2) is "2" . in this case it should filter out only 5 rows and rank will be 1 to 5 based on(DecActual-DecPlan) for that rows only.
4 REPLIES 4
Anonymous
Not applicable

Hi amit ,

Not able to share a file as its contains a lots of clients sensitive data.

Is there any way we can solve the issue?

amitchandak
Super User
Super User

@Anonymous , Try measures like these

Rank = RANKX(FILTER(KPI_Reporting,KPI_Reporting[condition(1/2)]="2"),[(DecActual-DecPlan)],,ASC)

 

or

 

Rank = RANKX(allselected(KPI_Reporting),calculate([(DecActual-DecPlan)],FILTER(KPI_Reporting,KPI_Reporting[condition(1/2)]="2")),,ASC)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

still Rank is not showing correctly

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.