Often the result of a calculation will have decimal places. However it is may not be required to show the decimal places at the time of visualization. In such cases you can use ROUND to truncate the output to the required number of decimal places. This can also be achieved in a number of other places such as within the visual or even within MQuery. The choice of where to use the ROUND function often depends on what you plan to do with the output of the calculation.
In the below example we calculate the average transaction amount per customer with and without decimal places. The screenshot shows the difference between the two calculations. Notice how even though the number has been rounded we can still see more than one decimal place
It will be interesting to note the grand total in the above case which doesn’t seem to make sense with the values in the screen. Until you scroll to the bottom of the table.
As a business you might want to avoid displaying these negative numbers in which case we can use CALCULATE and FILTER as shown in previous posts. Resulting in the output below
As can be see here it is often necessary to combine multiple DAX formula to get accurate results.
The SQL Equivalent of the above DAX function is