Issue
When creating histograms in Tableau Desktop that use decimal values for bin sizes, some decimal values may not be placed into the proper bins.
When creating histograms in Tableau Desktop that use decimal values for bin sizes, some decimal values may not be placed into the proper bins.
This behavior is caused by floating point issues.
Floating point arithmetic uses FLOOR() functions when interpreting decimal values like so:
FLOOR(0.95/0.001) = 949 ; FLOOR(0.95/0.0001) = 9500
This is due to the fact that none of 0.95, 0.001, or 0.0001 can be represented exactly in floating point, so they are represented with close, but not quite the same numbers, which when divided and floored produce inconsistent results. What most often happens is the decimal points are displayed as expected values, and their underlying data is based on FLOOR() functions that can slightly off-set the values.
This has potential to show some unexpected values/value behavior such as histogram binning, when displaying the decimals in different formats, or using them in calculated fields, etc.
A useful workaround, as noted above, is to multiply numbers by a constant scale factor. This will tend to make the results more accurate. Unfortunately, this isn't always true and the size of the scale factor is difficult to determine. If the user didn't get the right results multiplying by 100, they should try multiplying by 1000.