Forum Discussion
automan25
Oct 20, 2023Copper Contributor
Divide By Zero Error
I'm getting a divide by zero error notification when using the code below on a text box in my power app. Incidentally, the calculation actually shows the correct result; the error is shown in a standard notification banner. If I switch the divide operator to an ampersand to simply connect the values, each value shows as a whole number (and not zero), so this error should not be occurring.
Any ideas?
Sum(
Filter('Dataset', Record.Value = recordID.Text),
'Value A'
)
/
(
Sum(
Filter('Dataset', Record.Value = recordID.Text),
'Value A'
)
+
Sum(
Filter('Dataset', Record.Value = recordID.Text),
'Value B'
)
)
- I ran across this page which discusses the IfError function. That seems to have fixed my issue. Many thanks to Low Code Lewis!
https://lowcodelewis.com/blog/handling-the-division-by-zero-error-in-power-apps
1 Reply
- automan25Copper ContributorI ran across this page which discusses the IfError function. That seems to have fixed my issue. Many thanks to Low Code Lewis!
https://lowcodelewis.com/blog/handling-the-division-by-zero-error-in-power-apps