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

Re: Ranking is not showing correctly on card

@mwegener if you could help with this whenever you get time. I have tried many solutions but nothing is woring with card display. Rank is coming fine in table display but when I am selecting a name from slicer its not giving corrrect rank on card disply.

 

 

Re: Ranking is not showing correctly on card

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. I don't need to include the sales in calculation for which year is blank.

 

Thank you!

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@v-gizhi-msft  Thank you! I will check this and confirm if its my solution.

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@v-gizhi-msft hello, did you try this ranking measure on card display. its not showing correct ranking in card if I am selecting a name from slicer. In table its coming fine.

 

Highlighted
Super User III
Super User III

Re: Ranking is not showing correctly on card

Hi @Vish24 ,

 

@v-gizhi-msft  solution looks correct.

PBIX

But what do you mean with this?

If name is not selected the show the rank of 2018+2019.

 

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

Highlighted
Helper II
Helper II

Re: Ranking is not showing correctly on card

@mwegener sorry that was a mistake. I meant if year slicer is not selected then it should show rank of 2018+2019 sales.

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

Highlighted
Community Support
Community Support

Re: Ranking is not showing correctly on card

Hi,

 

The measure in a Card visual can only show the single value.

According to your description that if name is not selected, then it should show the rank of 2018+2019.

But for each year, it has different ranks and can not be put in a Card visual as one single value.

Do you want to compare 2018+2019 total sales with other year's total sales such as 2017 or 2016?

Please give more info.

 

Best Regards,

Giotto Zhi

 

Helper II
Helper II

Re: Ranking is not showing correctly on card

@v-gizhi-msft sorry, that was a typing error. I meant if year is not selected and only name is selected then it will show ranking based on 2018+2019 sales.

Highlighted
Community Support
Community Support

Re: Ranking is not showing correctly on card

Hi,

 

Please try this rank measure:

rank = IF(SELECTEDVALUE('Table'[Year])<>BLANK(),RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Sales])),,DESC,Dense),RANKX(ALL('Table'),CALCULATE(SUM('Table'[Sales])),,DESC,Dense))

 

Best Regards,

Giotto Zhi

 

Highlighted
Super User III
Super User III

Re: Ranking is not showing correctly on card

Hi @Vish24 ,


is your problem solved?
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

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