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
BSimmers
Frequent Visitor

Using the RANKX Function...return 1

Hi there - I am having trouble getting my RANKX function to work. I returns 1 for every row. See below, I am trying to do a rank by the ABSDayonDayPrice column. Any help would be welcome. Thanks, Ben.

 

BSimmers_2-1741992848259.png

 

 

 

 

2 ACCEPTED SOLUTIONS
Deku
Super User
Super User

Wrap the sum() in calculate() to for context transition to occur


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

replace ALL with ALLSELECTED


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

6 REPLIES 6
Deku
Super User
Super User

Wrap the sum() in calculate() to for context transition to occur


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
BSimmers
Frequent Visitor

That worked!! Thanks!

 

You might be able to assist with my next question...I need it Ranked by business date, it is currently ranking across all dates.

 

BSimmers_0-1741996365880.png

 

replace ALL with ALLSELECTED


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
BSimmers
Frequent Visitor

Thanks....again! this worked! Although ranked in the right order, I am getting false ties:

 

BSimmers_0-1742215075644.png

 

Try running on column(s) rather than table i.e. allselected(table[code]) so the sum is calculated on the required grain


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi,

Share the download link of the PBI file and show the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Top Solution Authors