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
Recoil
Regular Visitor

Rank Function Error

Hello everyone,

 

I am having a problem with the Rank function in a Report Table Visualization.  I have a simple table on a canvas.  It is reading from my table 'Data' and contains one column for Contract State and another column for "Absolute DnU Value" which is formatted as Currency.  

 

In the table, I am trying to rank the States with the highest "Absolute DnU Value" so I added a new measure with the formula below but it is giving me all 1's in the rank column.  If at all possible, would someone please help me to understand what I am doing wrong?   I greatly appreciate your time!

 

Rank = Rankx(All('Data'),Sum(Data[Absolute DnU Value]))

 

I even tried

 

Rank = Rankx(ALLSELECTED('Data'),Sum(Data[Absolute DnU Value]))

 

Recoil_0-1691705491717.png

 

1 ACCEPTED SOLUTION

Hi @Recoil 

 

Could you first create a measure for your "Absolute D&U Value"


Then use this measure in both your table and RANKX as shown below.

 

New Measure 

DnU Value = SUM('Data'[Absolute D&U Value])

 

Rank = Rankx(ALLSELECTED('Data'[Contract State]),[DnU Value]))

 





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

Proud to be a Super User!







Power BI Blog

View solution in original post

6 REPLIES 6
GilbertQ
Super User
Super User

Hi @Recoil 

 

You have to include the column name in your RANKX for it to work correctly.

 

This should work

 

Rank = Rankx(ALLSELECTED('Data'[Contract State]),Sum(Data[Absolute DnU Value]))




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

Proud to be a Super User!







Power BI Blog

@GilbertQ Thank you so much for responding/helping!!!! It is tremendously appreciated!

 

When I make that edit, the Ranking still does not produce.  Please see below.

 

Recoil_0-1691707038885.png

 

Hi @Recoil 

 

Could you first create a measure for your "Absolute D&U Value"


Then use this measure in both your table and RANKX as shown below.

 

New Measure 

DnU Value = SUM('Data'[Absolute D&U Value])

 

Rank = Rankx(ALLSELECTED('Data'[Contract State]),[DnU Value]))

 





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

Proud to be a Super User!







Power BI Blog

@GilbertQ That worked!   Could you explain to me why that had to be done so that I know for next time?

Hi @Recoil 

 

What happens when you have the SUM inside of the RANKX it cannot compare with the overall values to rank it. 





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

Proud to be a Super User!







Power BI Blog

Thank you so much for your time and expertise!!!  I greatly appreciate your time.

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.