Min Function 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 Min function finds the minimum value. The General syntax is Min( NumericalFormula1, [ NumericalFormula2, ... ] )

Reading this article, you can learn how to perform the Min 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.

Power Apps

Create Blank Canvas App

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

App name

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 “Min function in PowerFx using canvas App with Power apps”.

Text Label

Next, Insert a Label control and set the Name and Text property as LblApr and “April Expenses"

Label

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

Text Box

Next, Insert a Label control and set the Name and Text property as LblMay and “May Expenses"

May expenses

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

Number

Next, Insert a Label control and set the Name and Text property as LblJune and “June Expenses"

Label control

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

Format

Insert Button control and set the Name property as Calculate and Onselect property as UpdateContext({Apr:(TxtApr)});UpdateContext({May:(TxtMay)});UpdateContext({Jun:(TxtJune)});

Button

Insert Label control and set the Name property as LblRes and Text property as "The Minimum amount spent from April, May, June is "& Min(Apr.Text,May.Text,Jun.Text) for displaying Results.

Calculate

Finally, the form design looks like this.

Editing

Step 4. Now we can see the preview of your app in Power Apps Studio, and the output of the PAPFMin is.

Browser

After entering expenses, The Browser Displays.

Browser

The Apple iPhone Display.

Apple

The Tablet Display.

Tablet

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


Similar Articles