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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Radhika2605
Helper II
Helper II

Help with a visual

Hi, can someone please help me with this one?

 

I am working on an olympics database and I am trying to find out Top 5 countries with highest medals and in that visual I also want to show the different types of medals. 

 

I want to use Dax to show the Top 5 countries and don't want to use the filter pane.

 

The Dax measure which I am using to find the top 5 countries with highest medals is -

Top 5 Countries with highest medals =
CALCULATE(
[Total Medals],
FILTER(
VALUES( Country[Region] ),
RANKX( ALL( Country[Region] ), [Total Medals], , DESC ) <= 5 ))
 
I am trying to create a horizontal bar chart created as follows -
Axis - Region
Legend - Medal
Values - Top 5 Countries with highest medals
 
If I dont put the medal as legend then only 5 countries are returned as shown below:
Radhika2605_0-1629811499623.png

 

 

But as soon as I put the Medal in legend then I get 6 countries instead of 5-

Radhika2605_1-1629811547845.png

 

 

Can someone please guide me as to what am I doing wrong due to which 6 countries are being shown in visual instead of 5. Also, in the Top 5 Countries with highest medals measure, if I use 10 to find top 10 countries instead of top 5 and when I have medals in Legend then I get 12 results. 

 

My model -

Radhika2605_3-1629811723653.png

 

 

Thanks in advance!

Radhika

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Radhika2605 Can you share the PBIX? Going to be easier to see what is going on that way.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

Thanks for your response. Sorry file is a mess but still attaching it here.


Here is the file - 

https://drive.google.com/file/d/1WXp9F9w7cbMAr7IrtWh2Mxsj2ZlwaB70/view?usp=sharing

 

Thanks

Radhika

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.