- Power Apps Community
- Welcome to the Community!
- News & Announcements
- Get Help with Power Apps
- Building Power Apps
- Microsoft Dataverse
- AI Builder
- Power Apps Governance and Administering
- Power Apps Pro Dev & ISV
- Power Apps Portals
- Connector Development
- Power Query
- Power Platform Integration - Better Together!
- Power Platform Integrations
- Power Platform and Dynamics 365 Integrations
- Community Blog
- Power Apps Community Blog
- Demo Extravaganza 2021
- Demo Extravaganza - Components 2021
- Power Apps Community Demo Extravaganza 2020
- Galleries
- Community Connections & How-To Videos
- Community App Samples
- Webinars and Video Gallery
- Canvas Apps Components Samples
- Kid Zone
- Business Value Webinars and Video Gallery
- Emergency Response Gallery
- 2021 MSBizAppsSummit Gallery
- 2020 MSBizAppsSummit Gallery
- 2019 MSBizAppsSummit Gallery
- Ideas
- Power Apps Ideas
- Experimental
- Error Handling
- Community Support
- Community Accounts & Registration
- Using the Community
- Community Feedback

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Power Apps Community
- Forums
- Get Help with Power Apps
- Building Power Apps
- Making calculations in PowerApps

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Making calculations in PowerApps

3 weeks ago

Hi

could anyone please help me to do the below calculation through PowerApps. Currently i use to work with excel to find the results using below formulas. I would wish to do the same using PowerApps.

According to excel

__Formula one__ =0.001*(D12*D12*D14)/(2*G7)

In Formula one - i will input two values (i.e. in D12 and D14 cells) in excel to find the result and other value mentioned in the above formula are constants (i.e. value in G7 cell)

__Formula two__ =0.001*D19*D20*(1/D24)*(1-((D21/D19)^D23))

In Formula one - i will input two values (i.e. D19 and D20 cells) in excel to find the result and other value mentioned in the above formula are constants (i.e. values in D24,D21 and D23 cells)

In PowerApps I would choose whether to do calculation using Formula 1 or Formula 2. Based on selection the respective screen should appear and then i will input the two values required for calculation as same i did in excel. Finally the result should appear on the screen

Solved! Go to Solution.

3 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi @Gowtham_1

We can do formula's in Powerapps like below

`0.001*(Value(D12.Text)*Value(D12.Text)*Value(D14.Text))/(2*Value(G7.Text)) `

I hope you got the concept for the formulas to use.

Please let me know if you are looking in Gallery-like excel style format. We can do that as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi

Thanks a lot for your support... your solution works perfectly for Formula One... I seek your support for solving Formula two sir

In Formula two : I have added a dropdown box for selecting the "test medium" (as shown in the below picture ). If I choose test medium as " Helium" the parameters of helium should be taken for calculation or If I choose test medium as " Nitrogen" the parameters of Nitrogen should be taken for calculation... (parameter tables I have shown below). The blue highlighted text in parameter table refers "inputs which will be entered by app user" and other parameters remains constant based on test medium. The formula for calculating these parameters is 0.001*D19*D20*(1/D24)*(1-((D21/D19)^D23)).

At last my final request is based on the result, I need a to be display 3 types of text i.e. if the calculated result is less than 0.35 means "Text D " to be displayed in screen, if the calculated result is greater than 0.35 and less than 102 means "Text C " to be displayed, if the calculated result is greater than 102 and less than 271 means "Text B " to be displayed, if the calculated result is greater than 272 means "Text A " to be displayed,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi @Gowtham_1

Looks like row 16 and 18 are not part of the calculation. Anyway, here is the solution based on the formula

Steps:

- Have a collection to hold all constant data
- Dropdown to select type
- Label to show the calculation
- Another label to show final text message

Set OnVisible property of the screen to

```
ClearCollect(
Data,
{
type: "helium",
parameters: {
ValueVolumecc: 14970,
ValueVolumem3: 0.01497,
TestPressure: 101.3,
phNm2: 11143000,
vhm3: 0.01497,
p1Nm2: 101325,
Y: 1.4,
y1y: 0.28571429,
y1: 0.4,
UKJ: 308.148933
}
},
{
type: "Nitrogen",
parameters: {
ValueVolumecc: 14970,
ValueVolumem3: 0.01497,
TestPressure: 101.3,
phNm2: 11143000,
vhm3: 0.01497,
p1Nm2: 101325,
Y: 1.666,
y1y: 0.399759904,
y1: 0.666,
UKJ: 212.2082376
}
}
)
```

Set Dropdown Items property to

`["helium","Nitrogen"]`

Insert one Label (Name: CalculatedResult) and set text property to

```
With(
{
_item: First(
Filter(
Data,
type = Dropdown2.Selected.Value
).parameters
)
},
0.001 * Value(_item.parameters.phNm2) * Value(_item.parameters.vhm3) * (1 / Value(_item.parameters.y1)) * (1 - ((Value(_item.parameters.p1Nm2) / Value(_item.parameters.phNm2))^Value(_item.parameters.y1y)))
)
```

Insert another label to display the final text message

Set Text property of this label to

```
If(
Value(CalculatedResult.Text) <= 0.35,
"Text D",
Value(CalculatedResult.Text) > 0.35 && Value(CalculatedResult.Text) < 102,
"Text C",
Value(CalculatedResult.Text) > 102 && Value(CalculatedResult.Text) < 271,
"Text B",
"Text A"
)
```

Here is my sample

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi @Gowtham_1

We can do formula's in Powerapps like below

`0.001*(Value(D12.Text)*Value(D12.Text)*Value(D14.Text))/(2*Value(G7.Text)) `

I hope you got the concept for the formulas to use.

Please let me know if you are looking in Gallery-like excel style format. We can do that as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi

Thanks a lot for your support... your solution works perfectly for Formula One... I seek your support for solving Formula two sir

In Formula two : I have added a dropdown box for selecting the "test medium" (as shown in the below picture ). If I choose test medium as " Helium" the parameters of helium should be taken for calculation or If I choose test medium as " Nitrogen" the parameters of Nitrogen should be taken for calculation... (parameter tables I have shown below). The blue highlighted text in parameter table refers "inputs which will be entered by app user" and other parameters remains constant based on test medium. The formula for calculating these parameters is 0.001*D19*D20*(1/D24)*(1-((D21/D19)^D23)).

At last my final request is based on the result, I need a to be display 3 types of text i.e. if the calculated result is less than 0.35 means "Text D " to be displayed in screen, if the calculated result is greater than 0.35 and less than 102 means "Text C " to be displayed, if the calculated result is greater than 102 and less than 271 means "Text B " to be displayed, if the calculated result is greater than 272 means "Text A " to be displayed,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi @Gowtham_1

Looks like row 16 and 18 are not part of the calculation. Anyway, here is the solution based on the formula

Steps:

- Have a collection to hold all constant data
- Dropdown to select type
- Label to show the calculation
- Another label to show final text message

Set OnVisible property of the screen to

```
ClearCollect(
Data,
{
type: "helium",
parameters: {
ValueVolumecc: 14970,
ValueVolumem3: 0.01497,
TestPressure: 101.3,
phNm2: 11143000,
vhm3: 0.01497,
p1Nm2: 101325,
Y: 1.4,
y1y: 0.28571429,
y1: 0.4,
UKJ: 308.148933
}
},
{
type: "Nitrogen",
parameters: {
ValueVolumecc: 14970,
ValueVolumem3: 0.01497,
TestPressure: 101.3,
phNm2: 11143000,
vhm3: 0.01497,
p1Nm2: 101325,
Y: 1.666,
y1y: 0.399759904,
y1: 0.666,
UKJ: 212.2082376
}
}
)
```

Set Dropdown Items property to

`["helium","Nitrogen"]`

Insert one Label (Name: CalculatedResult) and set text property to

```
With(
{
_item: First(
Filter(
Data,
type = Dropdown2.Selected.Value
).parameters
)
},
0.001 * Value(_item.parameters.phNm2) * Value(_item.parameters.vhm3) * (1 / Value(_item.parameters.y1)) * (1 - ((Value(_item.parameters.p1Nm2) / Value(_item.parameters.phNm2))^Value(_item.parameters.y1y)))
)
```

Insert another label to display the final text message

Set Text property of this label to

```
If(
Value(CalculatedResult.Text) <= 0.35,
"Text D",
Value(CalculatedResult.Text) > 0.35 && Value(CalculatedResult.Text) < 102,
"Text C",
Value(CalculatedResult.Text) > 102 && Value(CalculatedResult.Text) < 271,
"Text B",
"Text A"
)
```

Here is my sample

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

thanks you so much anna for your extended support... your solution meets the request exactly

Top Solution Authors

User | Count |
---|---|

161 | |

123 | |

76 | |

37 | |

33 |

Top Kudoed Authors

User | Count |
---|---|

245 | |

151 | |

109 | |

69 | |

48 |