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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.