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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Dunner2020
Post Prodigy
Post Prodigy

Rankx basado en la columna de la tabla

Hola

Tengo datos que se parecen a la siguiente:

IdNo del cliente
AX1681081
FH53081046
CH2008551
FK77841336
WK27521456
QT5202390
AT7642525
AB4543
AT7692347
WK2755620
AX162607
CM822725
PC3500
EK480461
OT2305
ET5635
CH2006842
LF6576198
MG6443

Ahora quiero crear una medida que se clasifica en función de la columna de número de clientes. Escribí un código algo así:

Rango por cliente: RankX(ALL(Table),Table['No of Customer'],,DESC)

Sé que Table['No of Customer'] es el argumento equivocado y debe ser reemplazado por expression. Sin embargo, ¿no sabía cuál debería ser el reemplazo? ¿Alguien podría ayudarme en eso?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@myasir - Vea este artículo - https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hola

Prueba estas medidas

Recuento de clientes: SUMA(Tabla['No de cliente'])

Rango por cliente: RankX(ALL(Table[ID]),[Customer count],,DESC)

A su objeto visual, arrastre ID y Rank by Customer

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@myasir - Vea este artículo - https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler , seguí el artículo y cambié mi código a lo siguiente:

Rango del ICP - RANKX( ALL('Table'),[ICP],,DESC)
Pero todavía me dio un error que 'El valor para ICP no se puede determinar. La columna no existe o no hay ninguna fila actual para esta columna'.

@myasir , están intentando rango de columna (estático) o rango de medida (dinámico y sensible al contexto.

Nueva columna

Rango ICP - RANKX( ALL('Table'),[ICP],,DESC)

Nueva medida

Rango ICP - RANKX( ALL('Table'),Calculate(Sum([ICP])),,DESC)

O

Rango ICP - RANKX( ALL('Table'[Customer]),Calculate(Sum([ICP])),,DESC)

Rango ICP - RANKX( ALLSELECTED('Table'[Customer]),Calculate(Sum([ICP])),,DESC)

Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@myasir - Necesitas un agregador a su alrededor como SUM, MAX, etc.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors