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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
naveenvs
Frequent Visitor

Ranking after Filtering columns

I need to rank records in my tabe after filtering out certain records based on a Text column. Here is how data would look like and I need to rank and filter by "Category" column.

 

Powerbi1.PNG

 

Below is my formula , but this is ranking all the records regardless. The Rand column is a column that I added since there was no unique value column for indexing

Rank = RANKX(FILTER('Tablename',OR('Tablename'[category]=" Cycle 1",
'Tablename'[category]=" Cycle 2") && EARLIEST('Tablename'[RAND])),'Tablename'[category],,DESC,Dense)

1 REPLY 1
Anonymous
Not applicable

Hi  @naveenvs,

Here are the steps you can follow:

1. Create a measure.

RowNum =
CALCULATE (
    COUNT ( 'Table'[Category] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Category] <= MAX ( 'Table'[Category] )
    )
)

2. Result.

v-yangliu-msft_0-1603415600546.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors