cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hsy
Helper I
Helper I

Invalid Operation: Division by zero

Hello everyone,

 

Seems Power Apps made an update recently, my apps pop up many runtime error "Invalid Operation: Division by zero"

Imaging I have a formula written as 

 

 

IfError(1/Cost, 0)

 

 

It should avoid this issue at all, but the error keeps pop up in the Apps Checker.

Is there a way we can disable this?

 
 
15 REPLIES 15
v-xiaochen-msft
Community Support
Community Support

Hi @hsy ,

 

Please try this formula.

If(IsBlank(Value(ct_lb_ps.Text)),0,RoundUp(ThisItem.Quantity / Value(ct_lb_ps.Text),0))

 

The formula works fine in my environment.

 

Best Regards,
Wearsky

View solution in original post

Thanks you, thats great. it also works fine for me this time as well.

However can you report/forward this issue to developers?

Cause I have many formulas like this, some are very calculation intense, add extra layer of verification in a clunky app is like grinding it to halt. eg.,

Text(
    (Sum(
        Cart_Gallery_Cart.AllItems,
        Cart_TextInput_Price * Cart_TextInput_Quantity
    ) - Sum(
        Cart_Gallery_Cart.AllItems,
        Cart_Label_TotalPrice
    )) / Sum(
        Cart_Gallery_Cart.AllItems,
        Cart_TextInput_Price * Cart_TextInput_Quantity
    ) * 100,
    "[$-en-US] #0.00%"
)

 

v-xiaochen-msft
Community Support
Community Support

Hi @hsy ,

 

Please do a simple test to verify if your environment has problems using IfError() function.

 

1\ Open this setting

v-xiaochen-msft_0-1616729670933.png

 

2\ Add a textinput control 'TextInput1' and set its Default property to:

""

 

3\ Add a lable and set its Text property to:

IfError(1/Value(TextInput1.Text),0,1/Value(TextInput1.Text))

 

Please check if it reports an error or works normally.

 

Best Regards,

Wearsky

 

Yes, it produces error even in a new environment.

Capture.PNG

v-xiaochen-msft
Community Support
Community Support

Hi @hsy ,

 

The issue has been reported to the Microsoft team.

 

Best Regards,
Wearsky

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,091)