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
Angelo-Silva
Regular Visitor

Ranking com duas colunas

Ola Especialistas,
Gostaria de criar um ranking com base em duas colunas, conforme imagem(Produto e Fornecedor), onde o contexto de produto será respeitado e também o fornecedor

AngeloSilva_0-1675986629078.png

 

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

Hi @Angelo-Silva 

1.You can create a measure

 

Measure = RANKX(FILTER(ALLSELECTED('Table'),'Table'[Product]=MAX('Table'[Product])),CALCULATE(SUM('Table'[Valor])),,DESC,Dense)

 

vxinruzhumsft_0-1675994109215.png

2.You can create a calculated column

Column = RANKX(FILTER('Table',[Product]=EARLIER([Product])),[Fornecedor],,DESC,Skip)

vxinruzhumsft_0-1675994404590.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
rob7one
Helper I
Helper I

Hola 🙂

 

I try to describe my case a bit:

 

I would like to rank an amount of defects within 3 columns: month, plant and vendor column. Is that possible too by creating a custom column?

 

v-xinruzhu-msft
Community Support
Community Support

Hi @Angelo-Silva 

1.You can create a measure

 

Measure = RANKX(FILTER(ALLSELECTED('Table'),'Table'[Product]=MAX('Table'[Product])),CALCULATE(SUM('Table'[Valor])),,DESC,Dense)

 

vxinruzhumsft_0-1675994109215.png

2.You can create a calculated column

Column = RANKX(FILTER('Table',[Product]=EARLIER([Product])),[Fornecedor],,DESC,Skip)

vxinruzhumsft_0-1675994404590.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Obrigado, funcionou.

FreemanZ
Super User
Super User

hi @Angelo-Silva 

try like:

Ranking =
RANKX(
    FILTER(
        TableName,
        TableName[Products] = EARLIER(TableName[Products])
    ),
    TableName[Valor]
)

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.

Top Solution Authors