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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
Top Kudoed Authors