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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

RANKX with slicer

Hello everyone

I'm something new using power BI and I have a problem using RANKX and a Slicer. I attach two images of what happens when you select a year with the slicer and when it is not selected.

When using the slicer and selecting any year, the first position indicates a higher number than it should Without the slicer, itworks correctly and shows me the ranking starting from 1Al usar el slicer y seleccionar cualquier año, la primer posicion indica un numero mayor al que deberiaAl usar el slicer y seleccionar cualquier año, la primer posicion indica un numero mayor al que deberiaSin el slicer, funciona correctamente y me muestra el ranking iniciando a partir de 1Sin el slicer, funciona correctamente y me muestra el ranking iniciando a partir de 1
The measure I am using is as follows:

Filtered ranking = RANKX(ALLSELECTED('Data-WorldHappiness'[WorldHappiness[Country]]]),[Ranking],,ASC,Skip)


Similarly, I share the pbix file and the dataset that I am using
3 REPLIES 3
Padycosmos
Solution Sage
Solution Sage

Hope this helps:

Ranking filtrado = RANKX(ALLSELECTED('Data-WorldHappiness'[WorldHappiness[Country]]],'Data-WorldHappiness'[WorldHappiness[Año]]]),[Ranking],,ASC,Dense)
Padycosmos_0-1678655193768.png

 

Padycosmos
Solution Sage
Solution Sage

TomMartens
Super User
Super User

Hey @Syndicate_Admin ,

 

this will not work because you have a single table solution, because of this ALLSELECTED will consider all countries no matter the filter applied by the slicer. This will result to strange "values".

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.