This article notes an issue with precision for integer division
By default, the result of divisions of two integers defined in a compound metric is also an integer. Even if the metric is formatted to have decimal places, the values of the decimal is 0.
Follow the steps to obtain the precise decimal values
Suppose there are two facts, F1 and F2, which are mapped to two integer columns in a fact table
Create metrics M1=Sum(F1) and M2=Sum(F2) based on the above two facts. M1 is shown below as an example:
Create a compound metric M3=M1/M2, as shown below:
Format metrics M1, M2 and M3 to have 2 decimal places, as shown below:
Create a report with the above three metrics in the grid and execute it
Observe the result: all of the three metrics' decimal places are shown as ".00". The values are correct for M1 and M2 because they are integers which do not have decimal values. But for M3, the value is not expected if the division of M1/M2 is not an integer. In this case, 151.00/344.00=0.44
In order for M3 to have the precise value in the decimal places, one possible workaround is to define a compound metric M3=(M1x1.0)/M2, as shown below:
Observe the report result again: metric M3 is showing the expected decimal value.