cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JOKA Frequent Visitor
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
JOKA Frequent Visitor
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
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
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
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

Highlighted
JOKA Frequent Visitor
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!

 

JOKA Frequent Visitor
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
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors