The divide function eliminates the risk for zero division error. The three arguments of the divide function are:
For example to find ROI:
ROI = DIVIDE( SUM(TransactionData[Total Profit]), SUM(TransactionData[Cost (total)]),0)
Note: this must be made as a new Measure rather than a calculated column.