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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PetyrBaelish
Resolver III
Resolver III

RANKX formula vs. visual filters

I have a rankx formula that ranks a player by their Average points:

AVGPointsRank = RANKX(ALLSELECTED('Results'[Player]),'Results'[AVG Pts],,DESC,Dense)

Here's the Average Points measure:

AVG Pts = (SUM(Results[Points])-(SUM(Results[Played])-SUM(Results[Late]))) / SUM(Results[Played])

From this I have created the following visual:

AVG Points Rank.PNG

Everything appears fine up to this point, but I also have the following filters on my visual/page:

Visual filter: Played is greater than or equal to 5

Page filter: Type is not grand final

 

I only want my visual to show the top 5 ranked players (1-5), but when I use a visual filter AVGPointsRank is less than or equal to 5, the visual actually only shows 2 players. I have to manually adjust the visual filter to: AVGPointsRank is less than or equal to 9 in order to show 5 players. I then have to adjust this every week as the data changes (sometimes 9 works, sometimes 8...)

 

I believe this behaviour is because my measure isn't accounting for the visual/page filter based on Played/Type as described above, but I'm not sure how to accommodate that.

2 REPLIES 2
v-danhe-msft
Employee
Employee

Hi @PetyrBaelish ,

It is hard to reproduce your problem, could you please offer a simple pbix file to have a test if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your response.

 

Here's a link to the file:

https://www.dropbox.com/s/r44du3ar9jpfzkj/RANKX%20Problem.pbix?dl=0

 

The measures are in the table called Results.

 

The visuals are the one's to the right hand side of the "Current" page - for example the top right visual, entitled "AVG Points" currently has 6 players listed whereby the visual is filtered to show where the AVGPointsRank is less than or equal to 9.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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