cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Ranking is not showing correctly on card

Hello All,

 

I have seen so many posts and tried their solutions but nothing is working out. Please help me with this ranking:

I have my Data for sles with names and year:

Names  Year  Sales

A          2019    222

A          2019    456  

A          2018   678 

B          2019   555 

B         2018  33 

C        2018    23

 

I have two slicers for Name and Year: I want to show th rank of selected name with selected year. If year is not selected then combine ranking of 2018+2019 sales. My ranking is coming fine in table but its coming wrong in card.

 

Please Help!

 

 

 

C

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Ranking is not showing correctly on card

Hi @Vish24 

 

try this...

rank = RANKX(ALL('Table'[Name]),CALCULATE(SUM('Table'[Sales])),,DESC,Dense)

... and put an advanced filter on the (card) visual "Table [Year] is not blank"

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support. 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

I work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #BetterTogether

View solution in original post

19 REPLIES 19
Highlighted
Resolver I
Resolver I

Re: Ranking is not showing correctly on card

Hi @Vish24 ,

 

Perhaps that's because a card would only display first/last rank or count and a workaround to that would be to have a name selected by default in the name slicer, which users can then change to see the relevant rank for other names. I hope that helps. 

 

Best wishes,

 

T

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

Thank you for your response. I tried but still its not showing correctlt for some.

Highlighted
Resolver I
Resolver I

Re: Ranking is not showing correctly on card

That potentially means that there are some rankings missing or not calculated correctly, so I'd encourage you to review your rank calculation method. Perhaps you could share an image of that?

Highlighted
Super User IV
Super User IV

Re: Ranking is not showing correctly on card

Refer to this: Here I have tried to show 1st, 2nd rank by brand. In case the year is filter this should work

https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...

 

Also refer :

https://community.powerbi.com/t5/Desktop/Rankx-by-Group-with-filter/m-p/922597#M442150

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@amitchandak  Thanks! I will go through this and let you know if I am able to do this.

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@amitchandak I couldn't see the attached button to attach my sample file. But here is my data. I am not sure if the blanks for year are giving any problem:

 

NameSalesYear
A1232018
A232019
A455 
B342018
B3452019
C222018
C242019
C132019
C12 
D452018
D5652019
A3442018
A44442019
C222018
B1342018
B5674 
A3646542018
E24322018
E6572019
F576 
F23432018

I have slicer for name and year. I need to show rank of selected year and name in a card. If name is not selected the show the rank of 2018+2019. As on my page I have filter to take only non blank year values: 

 

Highlighted
Community Support
Community Support

Re: Ranking is not showing correctly on card

Hi,

 

Please try to add an index column in Query Editor.

And then create a measure to show the rank:

rank = RANKX(ALL('Table'),CALCULATE(SUM('Table'[Sales])),,DESC,Dense)

Add this measure into table visual, when you do not choose any slicer, it shows:

32.PNG

When you choose year and name, it shows:

31.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

 

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@v-gizhi-msft thank you for your response. But I want the final result for C with year 2019 to be rank 5 and sum of sales 37. its not ranking as per the total sales for each year

Highlighted
Community Support
Community Support

Re: Ranking is not showing correctly on card

Hi,

 

Please try to change the original rank measure to this:

rank = RANKX(ALLEXCEPT('Table','Table'[Year]),CALCULATE(SUM('Table'[Sales])),,DESC,Dense)

And it shows:

71.PNG

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors