Forum Discussion

ChrisMarini's avatar
ChrisMarini
Frequent Visitor
4 years ago

Format percentages in tooltips

I have a number of visualizations across several dashboards that show percentages based on a count of an ID variable (in this case, JPOID). the visual below uses a count of JPOID, then using the "show as % of grand total" option. I want the percentage to read round to the nearest whole number in the tooltip.

I tried creating a new column in the dataset that I could then format as I saw fit, but it had an unintended consequence that makes it unacceptable.The image on the left shows the dashboard with the created column being used with a certain county selected, and the one on the right uses the show as percent option. Using my calculated column, when I make a selection in one visualization, the other ones that show percentages highlight that selection as a percentage of the whole, not highlighting the values of that selection.

Is there a way to round percentages in a tooltip without this lose of readability/interactivity?

 

This is the code I used to generate my calculated column (JPOind is a column I made that just has a value of 1 for each observation to make counting/aggregating more straightforward, and JPOcount is then a column that counts the value of JPOind)
JPOpercent = 'PowerBI Data'[JPOind]/'PowerBI Data'[JPOcount]

1 Reply

  • You should use measures, not calculated columns.

     

    Also consider the option of creating dedicated tooltip pages where you can control the formatting better.