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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vbbang
Frequent Visitor

Show top 5 items in a slicer with two hierarchies

Hi, I have a pie chart with a hierarchy and the hierarchy is two level , first level is item urgent (Yes/No) and the second level is supporting team.

I have set up a pie chart with legends as above hierarchy and values as total number of incident tickets.

 

So when the pie chart visual loads , I am seeing urgent and non-urgent ticket counts and when you click on urgent and non-urgent sections in the pie chart , then you can drill down to see what are tickets with differrent support team.

 

What we would like to show is when I click on urgent and non-urgent sections in the pie chart, it should display me the top 5 support teams who has urgent and non -urgent tickets respectively. 

 

Hope it makes sense. 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vbbang 

You can try the Tooltip function to realize your need . When you put your arrow on the corresponding category, it will show the Top5 supporting teams .Please follow my steps .

(1)Add a new page to display the Top 5 supporting teams . Create a measure to return the Top 5 teams info .

rank = RANKX(FILTER(ALL('Table'),[item urgent]=MAX('Table'[item urgent])),CALCULATE(MAX('Table'[incident tickets])),,DESC,Dense)

(2)In visual filter ,set the measure is less than or equal to 5 , so as to return the information of the top 5 .

Ailsamsft_0-1645696513486.png

So you will get a result like this :

Ailsamsft_1-1645696513487.png

(3)Then start to set tooltip for pie chart . For details, please refer to the link below .

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-tooltips

When everything is set up, you can see an effect like this .

Ailsamsft_2-1645696513489.pngAilsamsft_3-1645696513490.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @vbbang 

You can try the Tooltip function to realize your need . When you put your arrow on the corresponding category, it will show the Top5 supporting teams .Please follow my steps .

(1)Add a new page to display the Top 5 supporting teams . Create a measure to return the Top 5 teams info .

rank = RANKX(FILTER(ALL('Table'),[item urgent]=MAX('Table'[item urgent])),CALCULATE(MAX('Table'[incident tickets])),,DESC,Dense)

(2)In visual filter ,set the measure is less than or equal to 5 , so as to return the information of the top 5 .

Ailsamsft_0-1645696513486.png

So you will get a result like this :

Ailsamsft_1-1645696513487.png

(3)Then start to set tooltip for pie chart . For details, please refer to the link below .

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-tooltips

When everything is set up, you can see an effect like this .

Ailsamsft_2-1645696513489.pngAilsamsft_3-1645696513490.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, Thank you so much. You saved my Day !

Can you please let me know what is the issue with below measure ?

 

Rank columnmeasure = IF (
HASONEVALUE('Table'[supporting team] ),
RANKX ( ALLSELECTED ( 'Table'[supporting team] ),CALCULATE(COUNT('Table'[item urgent]) ) ))
 
We dont have supporting teams unique , they repeat.
 
 

 

vbbang
Frequent Visitor

Hi, I tried this but received an error. Column "Measure" cannot be found or may not be used in this expression.

 

amitchandak
Super User
Super User

@vbbang , Create a TOP 5 measure for team

Top 5= calculate([Measure],TOPN(5,allselected(table[supporting team]),[measure],DESC), values(table[supporting team]))

 

Then use

if(isinscope(Table[supporting team]) ,  [Top 5] , [Meausre])

 

or

 

if(isinscope(Table[supporting team]) && isfiltered(Table[urgent ])  ,   [Top 5] , [Meausre])

 

 

refer

TOPN https://youtu.be/QIVEFp-QiOk

https://xxlbi.com/blog/new-dax-function-isinscope/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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