web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Invalid operation: div...
Power Apps
Answered

Invalid operation: division by zero

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi guys!

 

I have a problem with my syntax, I want to put a percentage with this code (CM/PC)*100 with my variables, but when I want to calculate, putting my data, it show me "Invalid operation: division by zero" 

 

can you tell me why?

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    If the value of PC is either 0 or blank (uninitialized), then you will have a division by zero, which is being shown in your app... If that's the case, then you will need to determine what you want the result to be. If you want a blank result, you can use an expression like the following:

    // since there is no "else" argument, the result will be blank if PC is blank or zero
    If (Not IsBlank(PC) And PC <> 0, (CM / PC) * 100)

    Another approach would be to use the IfError function, which can "catch" an error and replace it with something else:

    IfError( (CM/PC)*100, Blank() )

    Or you can replace it with some other value (for example, 0):

    IfError( (CM/PC)*100, 0 )

    Hope this helps!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This help me a lot, thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard