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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ldwf
Helper III
Helper III

Make tooltip show % of grand total, not of the top N in visual

I have a visua attached that shows the top 5 people with the most units sold.  The tooltip by default shows a percentage for each slice, but it calculates the percentage based on the 5 people in the visual.  I would like to have the tooltip % be calculated based on the total units sold for the entire population, not just the top 5.  I have tried the following formula but it gave me an odd value - % of Grand Total = DIVIDE(CALCULATE('Units Details'[Count of Units Sold]),CALCULATE('Units Details'[Count of Units Sold],ALL('Units Details'))).  The field Count of Units Sold is a measure I calculated that does a count distinct of unit IDs.  Once I get the calculation correct, do I need to create a new page showing this percentage and then define the page as a tooltip and have it show up on the pie chart when hovering?  I'm trying to avoid creating tooltip pages and just want the default percent to be replaced with the one I need

 percent.PNG

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @ldwf 

If you want to change the TOP 5 data from a number to a percentage, then you can change the Label content in Detail labels in the format as below screenshot shown

vyohuamsft_0-1721725086996.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

7 REPLIES 7
v-yohua-msft
Community Support
Community Support

Hi, @ldwf 

If you want to change the TOP 5 data from a number to a percentage, then you can change the Label content in Detail labels in the format as below screenshot shown

vyohuamsft_0-1721725086996.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

gmsamborn
Super User
Super User

Hi @ldwf 

 

I came up with some random data and wrote the following measures:

 

Amt = SUM( 'FactSales'[Amount] )

Pct = 
    DIVIDE(
        [Amt],
        CALCULATE(
            [Amt],
            ALL( 'DimSalesperson' )
        )
    )

 

 

I created 2 donut charts: one based on Amt and the other based on Pct.  With the Pct-based chart, I changed the 'Label contents' to 'Data value' (in the 'Detail Labels' section).

 

One note regarding your [% of Grand Total] measure:  when referring to a measure, don't include the table name.  By only including the table name for columns and not measures, it makes it easy to determine if you are referring to a measure or a column.

 

Let me know if you have any questions.

 

ldwf.pbix

 

(Also, I created a DimSalesperson table for demonstration purposes.)

I tried your solution but the percentage is still not correct.  My donut chart has a filter to select Top 5.  These are my steps:  1. I created a measure to count the number of units - Units Count = IF(ISBLANK(DISTINCTCOUNT('Unit Table'[UnitId])),0,DISTINCTCOUNT('Unit Table'[UnitId])).  I then created a measure to do percentage of grand total - 

Percent of Total =

DIVIDE(

    [Units Count],CALCULATE([Units Count],ALL('Unit Table')))

I added this field to the tooltip but the percentage value is much smaller than it should be

 

Hi @ldwf 

I realize that you can't upload your pbix because of security issues.

 

Would you be able to replicate the problem using mock data that reflects your model and upload it to Onedrive, Google Drive, WeTransfer, Dropbox, etc. or are you unable to upload anything?

 

I'd like to help but I kinda feel like I'm in the dark.

 

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.  Show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I am not able to upload the .pbix file for security reasons. The visual is showing the top 5 people based on units sold.  The grand total of all units sold by all sales people is 6798.  The total of the top 5 people is 6586.  The tooltip is currently calculating the percentage with the denominator being 6586 instead of 6798.  I need it to calculate the percentage using 6798 as the denominator

I cannot see a mistake in your measure.  I will not be able to help without a file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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