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! Learn more

Reply
LatverianKid
Frequent Visitor

RANKX with filter

Hi everyone, 

I'm having troubles with a RANKX. I'm trying to rank the countries based on the HappinnessRank variable. However, when I apply the filter, the rankx is not working properly and instead of showing "1" for the first item, its showing a higher value.

The DAX formula i'm using is the following 

Rank_Country = RANKX(ALLSELECTED(WorldHappiness[Country]),[Ranking],,ASC,Skip)

Without filterWithout filterwith the 2019 filter appliedwith the 2019 filter applied
 
Hope that you can help me,

Thank you in advance
1 REPLY 1
ribisht17
Super User
Super User

@LatverianKid 

 

You are filtering with Date , hence Date should be within ALLSELECTED but you have Country

 

> https://hevodata.com/learn/dax-allselected/#ex1

 

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

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