Search code examples
powerbidaxpowerbi-desktopdivide-by-zero

Power BI returning value >0 for when dividing by 0


Trying to calculate YTD Percent off an imported data set, but receiving a value >0 for division where there is no budget or expenditure.

I have tried both of the following dax measures to calculate that column:

Percent = divide(Actuals[Actuals],Budget[Budget])
Percent = IFERROR(Acutals[Acutals]/Budget[Budget], blank())

See photo here:

Data Output


Solution

  • It appears that these aren't exactly zero just very small (possibly due to floating-point error or something similar). So it isn't actually dividing zeros.

    One option to avoid this would be to round your numbers to some number of decimal places before trying to divide. E.g.

    Percent = DIVIDE ( ROUND ( Actuals[Actuals], 2 ), ROUND ( Budget[Budget], 2 ) )