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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.