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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
baby_cabbage
Frequent Visitor

RANKX measure Worked in Table 1 but Not in Table 2

Hello everyone,

I am encountering a challenge in Power BI related to ranking phone brands by the number of installs using RANKX. My measure [Rank Device Installs] functions correctly in Table 1.

baby_cabbage_0-1741097997409.png


However, when applying a visual filter in Table 2—specifically, filtering [Count Device Install] to be greater than 0—the ranking does not work as expected ([Rank Device Installs] returns 1 for ALL Phone Brands)

baby_cabbage_1-1741098021072.png

 

How can I ensure that [Rank Device Installs] works correctly in Table 2 when the visual filter is applied?


Additionally, as a bonus question, I would like the "Other" phone brand to always be ranked the lowest, even though it consistently has the highest number of installs. How can I modify the ranking logic to achieve this?

I have attached a sample file and would appreciate any guidance. Thank you!

https://drive.google.com/file/d/16HprjYeDa1YQD8bzME_UOrtXvbGSe51i/view?usp=sharing

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@baby_cabbage This should fix the filtering issue:

 RANKX(
    ALLSELECTED(Sheet3),
    CALCULATE([Count Device Install], ALLEXCEPT('Sheet3', Sheet3[Phone Brand]) ), , DESC, Dense
 )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@baby_cabbage This should fix the filtering issue:

 RANKX(
    ALLSELECTED(Sheet3),
    CALCULATE([Count Device Install], ALLEXCEPT('Sheet3', Sheet3[Phone Brand]) ), , DESC, Dense
 )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

It worked perfectly, Greg. Thanks!

However, why do you need to explicitly remove filters from everything? Is it because RANKX is also influenced by the visual filter on [Count Device Install]?

@baby_cabbage Yeah, honestly, this was a new and weird one for me. I'm not even sure why RANKX is being weird like this and I wasn't having much luck with RANK either. So...yuck.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.