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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Rank

Hi

 

I am having one column in table named [MeasureId] and [Earnings] is the Calculated measure. I have calculated Rank of Earning using RANKX function but for last 5 rows [Earnings] is same and that's why Rank for those rows is coming out to be same. Is there any way to showo Rank after 6th rows as 7,8,9,10

 

11.PNG

7 REPLIES 7
Anonymous
Not applicable

@Anonymous,

RANKX will return the same ranking for the same value, this is by design and it is the correct behavior.

In your scenario, please use the following DAX to work around this issue.

1.Create a summarized table using DAX below.

Table = SUMMARIZE(Table1,Table1[Measure[MeasureId]]],"NewEarning",[Earnings])

2. Then create a column using DAX below in the new table.

Rank = 
RANKX ('Table',
    RANKX ('Table',
        'Table'[NewEarning],
        ,
        ASC
    )
        + DIVIDE (
            RANKX (
                    'Table','Table'[Measure[MeasureId]]],
                ,
                ASC
            ),
            
                COUNTROWS (
                    
                        'Table'
                    )
                
                    + 1
            )
        )



Regards,
Lydia

Anonymous
Not applicable

Hi Lydia

 

I am confused anout this "NewEarning". I do not have this in my database. Can you please elaborate ho wit will work.

Anonymous
Not applicable

@Anonymous,

It is a column in the new table, you would need to firstly create a summarized table using DAX below.

Table = SUMMARIZE(Table1,Table1[Measure[MeasureId]]],"NewEarning",[Earnings])


Regards,
Lydia

Anonymous
Not applicable

Thanks Lydia for your response !!

 

I want to create as as Measure and not column so that It can be calculated in runtime considering slicers.

Anonymous
Not applicable

@Anonymous,

What field would you like to create slicer?

Regards,
Lydia

Anonymous
Not applicable

I mean to say as per Slicers Year, Client, the number of rows coming from table may vary. so for example if I select Client = 23 and Year = 2018 from slicer then, there could be only 5 'Measure'[MeasureId] may return whereas if I select Client=24 and Year=2017 then say may be 4 rows with 'Measure'[MeasureID] will return. And that's why I want to create Measure instead of column.

Anonymous
Not applicable

@Anonymous,

It seems that the table 'Measure'[MeasureID] locates in is dynamic, I doubt if it is possible to create a rank measure in this case. Could  you please share sample data of the table that includes year and client fields?

Regards,
Lydia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.