So I have a few input text boxes that operate off of an "IF" statement (see below):
We'll say that it goes...
A1, A2
B1, B2
C1, C2
D1, D2
I just want to create a field that adds all the values A1, B1, C1 & D1 together (so it should be 4)
Same for A2, B2, C2 & D2 - just want a field that adds all those values up.
Then I have another field that is defaulted at "2", so I want to divide that field over these two field requests above. So for example:
2/4 = 50%
Any ideas?
I'm sure this is super easy, but I'm blanking on this at the moment.
@AJ_Z - any ideas?
Solved! Go to Solution.
@ianallen13 If I got your question right your formular should look something like that:
(Value(textboxA1.Text) + Value(TextboxB1.Text) + .....) / Value(TextboxFixValue.Text)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@ianallen13 If I got your question right your formular should look something like that:
(Value(textboxA1.Text) + Value(TextboxB1.Text) + .....) / Value(TextboxFixValue.Text)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
You did - thank you. So simple, but this totally makes sense. Appreciated!
How do I show it as a %?
@ianallen13 you mean how to calculate that it will show 50% or how you can add the % Charakter?
The 50% - but I just figured it out. Thank you again!
@ianallen13 Glad you solved it. But I do want to show you another approach which might come in handy when Dealing with a lot of numbers
With(
{
A1: Value(txtA.Text),
B1: Value(txtB.Text),
C1: Value(txtC.Text),
D1: Value(txtD.Text),
Devider: Value(txtDevider.Text)
},
Devider / (A1 + B1 + C1 + D1) * 100
) & "%"
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
How about another one...
Value(txtDevider.Text) / Sum([txtA, txtB, txtC, txtD], Value(Value.Text)) * 100
PowerApps LOVES tables!! In the above, the trick is that we are providing a table to the Sum function (which loves tables). The table happens to be of controls - not values or any other property. Since we use the square bracket syntax for the table, PowerApps will automatically create a table with a Value column. The value in the column will be a control. Then we do the conversion on the Text to sum. In that case we are getting the Value (text to number) of the Value (column name) and the .Text property (column).
This shortcut is very easy to add to if you end up with more controls to sum.
The only thing to keep in mind - PowerApps is VERY particular about schema. So in the above, the txt controls need to ALL be the same type of control. You could not use labels and TextInput at the same time as the two controls have different schemas. BUT, if you end up with different control types, then you can just specify the property in the table. Ex. Sum([txtA.Text, txtB.Text, txtC.Text, txtD.Text], Value(Value)) IN this case, the .Text property definition moves to the table, so it is not needed in the Value...it is already there!
Enjoy!!
Thank you guys! Appreciate and love the help!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
186 | |
45 | |
45 | |
36 | |
35 |
User | Count |
---|---|
262 | |
83 | |
78 | |
69 | |
67 |