Max Fnction in PowerFx using Canvas App with Power Apps

Power Apps is a suite of apps, services, connectors, and data platforms that provide a rapid application development environment to build custom apps for your business needs. More Details https://docs.microsoft.com/en-us/powerapps/powerapps-overview.

Power Fx is the low-code language that will be used across the Microsoft Power Platform. It's a general-purpose, strong-typed, declarative, and functional programming language.

The Max function finds the maximum value. The General syntax is Max( NumericalFormula1, [ NumericalFormula2, ... ] )

Reading this article, you can learn how to perform the Max function from Power Fx using Microsoft Power Apps. Also, you will be able to learn Text box and label control in the Power Apps environment.

Step 1. Open the URL https://powerapps.microsoft.com/en-us/ in the browser for Power apps.

Create an account with your Organisation Mail ID and log in after logging into your Power Apps account.

Step 2. First, Click Create (+ ) and Select the Canvas app from blank.

Create Power Apps

Create Blank App

Create Canvas apps

Next, give the app name as PAPFMax and format it as Tablet.

Canvas app from blank

Step 3. To test the power function, first rename the screen as SCRPAPF.

Power function

Next, Insert a Label control and set the Name and Text property as LblTitle and “Max function in PowerFx using canvas App with Power apps”.

Text Label

Next, Insert a Label control and set the Name and Text property as LblM1 and “Tamil"

Text

Next, Insert a TextBox control and set the Name and Format property as TxtTamil and Number.

Text input

Next, Insert a Label control and set the Name and Text property as LblEng and “English"

Text

Next, Insert a TextBox control and set the Name and Format property as TxtEnglish and Number.

Text input-english

Next, Insert a Label control and set the Name and Text property as LblMat and “Maths"

Maths

Next, Insert a TextBox control and set the Name and Format property as TxtMaths and Number.

Text box

Next, Insert a Label control and set the Name and Text property as LblSci and “Science"

Name-text

Next, Insert a TextBox control and set the Name and Format property as TxtSci and Number.

Name format

Insert Button control and set the Name property as Calculate and Onselect property as UpdateContext({Tam:(TxtTamil)}); UpdateContext({Eng:(TxtEng)}); UpdateContext({Mat:(TxtMaths)}); UpdateContext({Sci:(TxtSci)});  

onSelect

Insert Label control and set the Name property as LblRes and Text property as "The Maximum Mark from Tamil, English, Maths, Science is    "& Max(Tam.Text,Eng.Text,Mat.Text,Sci.Text) for displaying Results.

Calculate

Finally, the form design looks like this.

Max function

Step 4. Now we can see the preview of your App in Power Apps Studio, and The output of the PAPFMax is,

Output design

After giving the input and Clicking the Calculate Button, The Browser Display is,

Browser display

The Apple iPhone Display is,

Apple display

The Tablet Display is,

Tablet display

Now, you have successfully tested the Power Fx – Max function in the Power Apps Studio environment.


Similar Articles