cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JOKA
Frequent Visitor

RANKX in Card

Hi!

I´m having trouble with a Rankx measure when displaying on a card. 

I have a rank of sales by user: Rank = RANKX(ALL(TABLE[User]);[Sales];;DESC;Dense)

If I use Rank in a table all users have the correct rank value, it works fine.

okrank.png

 

 

 

 

 

 

 

 

 

I also need to have a card, so that when I select the user from the table the card shows me the rank value. The problem is that in a couple of cases it shows me the wrong value. For example in this case, I click on row #3 in the table but the card shows me #4:

rank.png

 

 

 

 

 

Does anybody know what am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
JOKA
Frequent Visitor

Re: RANKX in Card

In case there´s someone else with the same problem. There´s something wrong when you try to rank decimals. To solve the problem we had to change the measure in the overall rank to integer.


View solution in original post

5 REPLIES 5
ashisharora1909
Frequent Visitor

Re: RANKX in Card

Hi @JOKA ,

 

You can create the following two measures to display rank:

 

Normal Rank = 

RANKX(ALLSELECTED(TABLE[User]),CALCULATE(SUM([Sales]),,DESC,Dense)

 

Overall Rank = RANKX(ALL(TABLE[User]),CALCULATE(SUM([Sales]),,DESC,Dense)

 

Then try putting the Normal Rank in a table visual and then Overall Rank Measure in the Card Visualization. Now if you will slice and click on, let's say Rank 3 record in the table, the card will show Rank 3 as well.

 

Hope this helps. 

 

**Please mark this as answer if it solves your problem. Thanks

JOKA
Frequent Visitor

Re: RANKX in Card

Thank you @ashisharora1909. I tried this but it doesn´t work. I believe there´s something else. I tried the same solution that you gave me in another dataset and it works perfect, but in this one it doesn´t. The only difference that I can see is that there are negative values in the Sales mesasure in this one, could that be the problem?

ashisharora1909
Frequent Visitor

Re: RANKX in Card

I don't think it is because of the negative sales figures. To test this quickly is to wrap the ABS function on Sales and see if this works as expected. If not, any chance you could attached the PBIX file in here with removing the sensitive bits. I believe it may be because of the filters/slicers that are passing through which can be viewed by clicking on Edit Interactions and hovering on the card visual.

 

Thanks

Ashish

JOKA
Frequent Visitor

Re: RANKX in Card

Hi @ashisharora1909 ! I still can´t solve this problem. I tried your recommendation in another dataset and it works perfect. But in this one it doesn´t.

I am sharing the link to the .pbix file: https://drive.google.com/file/d/155T88JrH1mciasgj3Dcx_7ZHwZwxV842/view?usp=sharing

Hope you could help me. I would be very grateful!

 

Highlighted
JOKA
Frequent Visitor

Re: RANKX in Card

In case there´s someone else with the same problem. There´s something wrong when you try to rank decimals. To solve the problem we had to change the measure in the overall rank to integer.


View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors