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
Paula
Helper I
Helper I

RANKX DAX - Columnas y Filas

Hola,

 

Necesito realizar un ranking, y no logro hacerlo.

 

Tengo distintas columnas como medidas, es decir tengo una columna para Ventas 1, otra columna para Ventas 2 y otra para Ventas 3. Además tengo una columna que me indica las clasificaciones (A,B,C) para cada Venta, quedando algo así:

 

                A      B       C

Venta 1   10    20       90        

Venta 2   40    80       60

Venta 3   70    50       30

Total      120  150     180

 

 El ranking necesito realizarlo en base al total de cada clasificación. Quedando así el ranking:

 

                A      B     C

Venta 1    3     3       1        

Venta 2    2     1       2

Venta 3    1     2       3

 

Muchas gracias!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Paula,

 

To achieve your requirement, create a calculate column using DAX as below:

Rank = RANKX(FILTER(Table1, Table1[Category] = EARLIER(Table1[Category])), RANKX(ALL(Table1), Table1[Value]), , ASC, Dense)

捕获.PNG 

 

You can also refer to PBIX file here: https://www.dropbox.com/s/xl0kr9grzl9gg9l/RANKX%20DAX%20-%20Columnas%20y%20Filas.pbix?dl=0.

 

Best Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi Paula,

 

To achieve your requirement, create a calculate column using DAX as below:

Rank = RANKX(FILTER(Table1, Table1[Category] = EARLIER(Table1[Category])), RANKX(ALL(Table1), Table1[Value]), , ASC, Dense)

捕获.PNG 

 

You can also refer to PBIX file here: https://www.dropbox.com/s/xl0kr9grzl9gg9l/RANKX%20DAX%20-%20Columnas%20y%20Filas.pbix?dl=0.

 

Best Regards,

Jimmy Tao

Muchas Gracias! @v-yuta-msft

 

Me podrías ayudar con esto?:

 

 

 

 

Ahora necesito realizar un ranking pero de manera horizontal, por ejemplo sobre las Ventas 1. Pero esta vez necesito que se realice el ranking solo sobre A y C, quedando los ranking: C= 1° y A= 2°, sin tener que eliminar de la base a la categoria D.

 

 

Saludos!

 

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.