Rounding may be accomplished in Tableau Desktop with the ROUND() function. However, the aggregation must be considered when writing the calculation as Tableau may interpret the calculation relative to the aggregations applied. For example, if the field needed to round is SUM([Field]) and the calculation usedd is ROUND([Field]) then Tableau will interpret said calculation as SUM(Round([Field]).
To fix this behavior, rewrite the above calculation example as follows: ROUND(SUM(Field))
To view a concrete example, please see the attached workbook called Round String.twbx.
Use additional string modifiers such as LEFT() as well as additional rounding function such as CEILING() to create a more accurate representation.
View the underlying data to verify the original number to ensure that it is being rounded correctly for the number format. For example, an original value of 40.48 would be correctly rounded to 40.5 if one decimal place was specified and 40 if zero decimal places were specified.
As this behavior is not specific to Tableau Desktop, it is more fundamental to how computers store data, specifically what we consider "decimal" values. Integers are easy, by just adding or subtracting one whole number, you can do the same with binary data:
However, with decimal values, translating those distinct values to a binary representation, sometimes a simple representation in decimal does not translate perfectly to binary.
For example, .1 is simple in decimal but the number representing this value in binary might simultaneously represent both .0999999999999999 and .1000000000000001 and all numbers between. (Notice there are exactly 16 decimal places in each number.) This can be handled when we show the number values in the display layer, but doing math on the values or converting the values to strings will display the underlying values and this behavior changes based on a number of factors including the data base.
Here are a few examples / articles that demonstrate how this issue manifests across languages and is a fundamental issue in computer science.
For discussion on this topic and possible workarounds in Tableau Desktop, please see the following Community Forums thread: Round and then convert to a string.
For more information about the ROUND() function, see the following Tableau Help documentation: Number Functions.
001473206
1197 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.