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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

@Anonymous 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

@Anonymous 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...
Anonymous
Not applicable

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]?

@Anonymous 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.