There are a couple of ways to deal with this that don't require coding. First, point at the field in the measure shelf, right-click on it, select Field Properties, then select the percent number type and pick the number of decimal places you would like to display. That method defines a default data type for all uses of that measure in any worksheet.
If you just want to change the number type in a particular use for a specific worksheet. Point at the number in your worksheet, right-click, select format. You should now see the Format Measure Values shelf appear in the upper left side of your desktop. Select the "Fields" drop down arrow to insure that you are formatting the specific number you want to format. Then, go to the Numbers shelf in the Default area and select the Percentage type - again telling Tableau how many decimal points to display.
The second method will only define the format for that specific use in that particular worksheet.
So, by using the first method you are defining for Tableau a new default for displaying that measure. The second method allows you to override the default for specific uses in specific worksheets.
I hope that helps. No calculation is needed.
What Dan said. But you should also be aware that if you're using any calculated field to let the user select different measures for instance, the formatting will not survive the calculation, and you will have to specify the formatting within another calculation. But that's a longer discussion, so hopefully Dan's way will work for you.
Thanks for the reply.
Dan's solution wont work for a dynamic formatting. Do you know of a way to format the data type by code?
1 of 1 people found this helpful
Here are a couple of links (Shawn, were these the ones you were looking for yesterday?) that might help:
I hope you are well!
I have the same problem, but when I change the format, a original number that was 0,80 change to 8000,00%, and should be just 80%. Can you help me to solve this situation? what am I doing wrong?
Thank you very much!
you can go to the selected measure, select Default Properties -> number format
Then select ( Percentage ...) from the dialog left side.