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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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