VarP 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 VarP function calculates the variance of its arguments.The General syntax is VarP( NumericalFormula1, [ NumericalFormula2, ... ] ).

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

Power App

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

Canvas App

Create

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

 PADPFVar

Step 3. To test the power function, First Rename the Screen name as SCRPAD.

SCRPAD

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

 PowerFx

Next, Insert a Label control and set the Name and Text property as Lblinv2022 and “Investment Returns 2022".

Investment Returns

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

Textbox

Next, Insert a Label control and set the Name and Text property as Lblinv2023 and “Investment Returns 2023".

Label Control

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

Textbox Control

Next, Insert a Label control and set the Name and Text property as Lblinv2024 and “Investment Returns 2024".

Text property

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

 Format property

Insert Button control and set the Name property as Calculate and Onselect property as UpdateContext({Y2022:(Txt2022)}); UpdateContext({Y2023:(Txt2023)}); UpdateContext({Y2024:(Txt2024)});.

Updated Context

Insert Label control and set the Name property as LblRes and Text property as "The Variance is "&VarP(Txt2022.Text, Txt2023.Text, Txt2024.Text) for displaying Results.

Insert Label

Finally, the form design looks like this.

Form Design

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

Apps Studio

After Changing the Marks in the slider control, The Browser Display is.

Browser Display

The Apple iPhone Display is.

Apple iPhone Display

The Tablet Display is.

Tablet Display

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


Similar Articles