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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ae1999
Regular Visitor

tooltip showing top 10 rows and summing the rest as Other

 Hi all, 

 

I'm trying to create a custom tooltip but I got a little stuck, the following link leads to the sample dashboard: https://drive.google.com/file/d/1Orw9lL_6VzcnV6CQj1-L1gHWaCLbER11/view?usp=share_link

Because for some reason I can't attach a file (yet) with my new account. 

The dashboard is only a slightly modified version of this blog: https://www.oraylis.de/blog/2016/show-top-n-and-rest-in-power-bi

 

What I am trying to do is the following: 

I have a barchart of sales per product category and I want my tooltip to show the top 10 sales on item level and classifying the rest as other, so the totals will match up with value in the barchart. I managed to create measures for topN and other. But I couldn't make this work in a tooltip as described. 

 

Thanks a lot, 

 

1 ACCEPTED SOLUTION
5 REPLIES 5
amitchandak
Super User
Super User

@ae1999 , Create a tooltip page with item  and TOPN measure (using sales measure )

 

example

CALCULATE([Sales],TOPN(10 ,all(Item[Item]),[Sales],DESC),VALUES(Item[Item])))

 

 

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

Power BI Tooltip Page: How to pass selective values to the tooltip page: https://www.youtube.com/watch?v=lEq7YtkxeLU

 

Dear @amitchandak,

 

Thank you for your quick reply. I tried to make a measure as you suggested and this seems to work to get the top 10 sales values indeed. But this measure does not classify all remaining sales (outside the top 10) as other. By using the suggested measure I also run into some issues with passing the filters. But that probably happens because of the different data levels (category vs model). 

 

Thanks a lot!

@ae1999 , If you have more than one measure use TOPN in FIlter or use TOPN Measure has filter

 

or have more measures , like gross based on TOPN of sales

 

CALCULATE([Gross],TOPN(10 ,all(Item[Item]),[Sales],DESC),VALUES(Item[Item])))

 

If you need TOP based on two columns

 

2 column top N = CALCULATE([Net], TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[Brand], 'Item'[Category]), [Net],DESC),VALUES('Item'[Brand]), VALUES('Item'[Category]) )

Hi @amitchandak

 

Thanks again for your help. This works perfectly to filter the top 10 indeed. But this does not classify the remaining part as "other". In which case the totals wouldn't add up. I hope that clarifies it a bit more, let me know if something is unclear! 

 

Thanks a lot, 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.