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
scorbin-j
Helper I
Helper I

RANKX(ALLSELECT()) not working as expected

I have a table called All Hours that is an appended table from an Actual Hours table and Budget Hours table. It contains an ID Number, Actual hours, Budget hours, and Delta hours. Delta hours is a column created from Budget hours - Actual hours. Example of the table is this: 

scorbinj_0-1717778704327.png

 

I then created a measure of Sum Delta = SUM(Delta). I use this measure to create the Rank Delta measure which is Rank Delta = RANKX(ALLSELECTED('All Hours'), 'Measure'[Sum Delta],,ASC,Dense). That gives me these results:

 

scorbinj_1-1717778986632.png

 

I was expecting to see results for the ranks being 1-4 here. I am not sure why I am getting these results or where I am going wrong. The other thing I would mention is I am doing a similar thing in the same report, but using a different source table that is not an appeneded table and I get the results I expected to get. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @scorbin-j 

Thanks for @rajendraongole1 help. After reading your description carefully, the Delta column is a Measure, you can try to use the following Measure.

vyaningymsft_0-1718695064675.png


Rank Delta = 
RANKX(ALLSELECTED('All Hours'), 'All Hours'[Delta],,ASC,Dense)

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi, @scorbin-j 

Thanks for @rajendraongole1 help. After reading your description carefully, the Delta column is a Measure, you can try to use the following Measure.

vyaningymsft_0-1718695064675.png


Rank Delta = 
RANKX(ALLSELECTED('All Hours'), 'All Hours'[Delta],,ASC,Dense)

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

rajendraongole1
Super User
Super User

Hi @scorbin-j - Create a new measure with RankX function as below

 

I have created two measures:

Measure 1: for total on delta

deltaram = SUM(Rnak[Delta])

 
Measure 2: to find the rank in sequence
Rank Delta_2 = RANKX(
    ALLSELECTED('Rnak'[ID Number]),
    [deltaram],
    ,
    ASC,
    DENSE
)
 
 
I have taken a table chart, output for your reference.
 
rajendraongole1_0-1717780144116.png

 

 

Please use the same and let me know.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Power BI doesn't seem to be letting me sum the Rank Delta measure. 

Hi @scorbin-j - what is the error you can share it here,

 

please create a measure for delta, use that delta measure in Rank measure .

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





It says the that it can't be found or used in the measure

scorbinj_0-1717781449258.png

 

Hi @scorbin-j - Please cross check the table name you are using and in your table first calculate RankDelta column as below:

 

Take a calculated column use the below dax:

RankDelta = Rnak[Budget Hours]-Rnak[Actual Hours]

 
 

rajendraongole1_0-1717782699256.png

 

after that Create your measure:

 

sum Rank Delta = sum(your TableName [RankDelta])

 

 

it works

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





The Rank Delta is a measure, not a column in a table. That table with the Rank Delta is just the table visual in Power BI. 

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.