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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Petan65
Frequent Visitor

RANKX always returns 1

Hello,

 

I went throught a lot of threads about this topic but any of the solutions hasn't work. I probably know why it's not working, but I don't know how to fix it. The reason is because all 3 customers have the same number on some line in database and power BI is not taking ranking it from the total.  Výstřižek.PNGVýstřižek2.PNG

 

 

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Petan65 
Try to do it with 2 measures : 

1. total sales = sum('Table'[Sales])
2. 
Customer ranked by Sales =
RANKX(
    ALL('Table'[Customer]),
    [total sales]
)
Unfortunately, I am out of the limit of images that I can attach to discussions.
So I prepared a sample PBIX, you can download it from This link 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @Petan65 
The card can't be filtered because it doesn't have a row context, unlike tables which are filtered by rows (categories), graphs which have this on axes, etc...
What do you want from card to show? There is no card on the linked file...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi @Petan65 
Try to do it with 2 measures : 

1. total sales = sum('Table'[Sales])
2. 
Customer ranked by Sales =
RANKX(
    ALL('Table'[Customer]),
    [total sales]
)
Unfortunately, I am out of the limit of images that I can attach to discussions.
So I prepared a sample PBIX, you can download it from This link 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Yes it works 🙂 thank you.

Happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Sorry to bother you again. I thought that it all works as it should and in final step it stopped :/. Do you know why card visual does not show filtered value? Istead it shows total. Thank you
This link

Hi @Petan65 
The card can't be filtered because it doesn't have a row context, unlike tables which are filtered by rows (categories), graphs which have this on axes, etc...
What do you want from card to show? There is no card on the linked file...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Sorry in this file is the card. I need to show in card visual same result as have the table.

this link  

Edit: I've run into a second problem. When I would like to show the top 2 by month in the chart visual. It only works when I change X axis from date to "customer". Do you know how to make it work?
thank you

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors