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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to perform and dis...
Power Apps
Unanswered

How to perform and display calculation

(1) ShareShare
ReportReport
Posted on by 36

I have a canvas powerapp with text input fields. I want to perform calculations such as multiplication and division then display the result on the same screen. How can I achieve this?

 

Example:

  • Text Input 1 (user enters 😎
  • Text Input 2 (user enters 906)
  • Calculation performed (1-(Text Input 1/Text Input2)) = 99.1%
  • Results (99.1%) displayed in a 3rd field (Not sure what field type is required?)
Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @jms0529 ,

    To perform and display calculations from two input fields in Power Apps:

    Use two Text Input controls (e.g., TextInput1, TextInput2) for users to enter numbers.
    Place a Label control to show the result.
    Set the Text property of the Label to:

    If(
     IsNumeric(TextInput1.Text) && IsNumeric(TextInput2.Text) && Value(TextInput2.Text) <> 0,
     Text(
     1 - (Value(TextInput1.Text) / Value(TextInput2.Text)),
     "0.0%"
     ),
     "Invalid input"
    )

    This formula calculates the result when both inputs are numeric and the second input is not zero, then formats it as a percentage. If the inputs are not valid, it displays "Invalid input".

    Please accept this solution if it resolves the issue. ✅
    Best regards,
    Muhammad Ali

  • Hassan_SZ_365 Profile Picture
    542 on at

    Hi @jms0529 ,

    To perform and display calculations in a PowerApps canvas app, you can use labels to show the result. Here's a simple guide:

    1. Add Text Inputs: Place two Text Input controls on the canvas for users to enter numbers (TextInput1 and TextInput2).

    2. Perform Calculation: Write a formula to perform the calculation based on the values entered in the text inputs. Use the Value() function to convert text to number.

    3. Display Results: Use a Label control to display the result. Set its Text property to the calculation formula.

    Here's a step-by-step example:

    1. Add two Text Input controls (TextInput1 and TextInput2).

    2. Add a Label to the canvas to display the result.

    3. Set the Text property of the result Label to the following formula: 

     

    Text(1 - (Value(TextInput1.Text) / Value(TextInput2.Text)), "0.0%")

     

    The Value() function converts text to a number, and the Text() function formats the number as a percentage with one decimal place.

    Make sure that the input fields are set to accept only numerical input to prevent errors in the calculation.

    If you want to store the result in a variable and use it elsewhere in your app, you can use the Set() function on some event (like OnChange of the text inputs) to perform the calculation and store the result. For example:

     

    // OnChange property of TextInput1 or TextInput2
    Set(
     ResultVariable,
     1 - (Value(TextInput1.Text) / Value(TextInput2.Text))
    );​

     hen set the Text property of the Label to: 

    Text(ResultVariable, "0.0%")

     

    By following these steps, you will be able to perform the calculation and display the result on the same screen in your PowerApps canvas app.

     
     

    Best Regards,
    Hassan Raza

  • Ninja_365 Profile Picture
    99 on at

    Hi @jms0529 ,

    you can try this 

    Text(1 - (Value(TextInput1.Text) / Value(TextInput2.Text)), "0.0%")

    I hope this helps you set up your calculation in the app! If you find this solution helpful, feel free to accept it. 😊

  • CU10021449-0 Profile Picture
    22 on at
    In your Canvas PowerApp, you can use a Label to display the calculated result. First, add two Text Input fields (e.g., txtInput1 and txtInput2). Then, add a Label and set its Text property to:
    Text(1 - (Value(txtInput1.Text) / Value(txtInput2.Text)), "0.0%")
    This formula converts the text inputs to numbers, performs the calculation, and formats the result as a percentage. The label will automatically update when the user enters new values.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard