cancel
Showing results for
Did you mean:
Post Prodigy

## Multiple calculations from different textinputs

Hello Power Apps Community,

I am running into a road block. What is the best way to archive the following scenario? So, l am building this app for all nurses in the company. It is a chart scoring app.  As you can see there are 12 Text Input controls. What I need is to somehow calculate the scores by Categories input (Category, Weighted, Cumulative).

Example scenario:

When a nurse types 100% for Category in Chronic Condition it should calculate the Weighted and Cumulative under Chronic Condition. Then if the nurse types in 100% for Category and 40% in Weighted for TCM-TOC it should total up from Chronic Condition and work vice versaI hope l am making sense.

Sample screenshot of the final solution.

Please let me know if l explain myself clearly. Thank you so much in advance.

8 REPLIES 8
Super User

Could you explain the calculations behind the three controls?  Which ones are the nurses going to use to enter the data?

Super User

Yah like @Drrickryp said we definitely need more info, because in example none of the formulas appear to be same for any of the examples

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Post Prodigy

Thank you both @Drrickryp  @TheRobRush for the quick response. My apologies. under a little pressure.

Post Prodigy

Below is the finishing solution. Let me know if this helps. @Drrickryp @TheRobRush

The way it should work for the nurses is they will start selecting Yes, No, NA, or Other. When they select "Other" it will prompt them with a combo box with the following (25%,50%, 75%) and that should start the scoring.

I have a table for the radio button.

``Table({Item:"Yes", Value:100},{Item:"No", Value:0},{Item:"N/A"},{Item:"Other"})``

For the Gallery I have the following formula that I added to each of the Category score sections (Chronic, TCM-TOC, Acute, Health Maintenance). TextInput2 is where I keep score from the radio button chosen. It is hidden for now.

``Text(Sum(Gallery1.AllItems,TextInput2)/CountRows(Gallery1.AllItems)*100,"#%")``

TextInput2

``If(Radio1.Selected.Item="Other",Combox`.Selected.Rating,Radio1.Selected.Value & "%")``

For the Category, Weighted and Cumulative score they are all Text Input control (Display Mode: View)

Please let me know if you need additional information. My apologies again. It was supposed to go live today. Stuck with the scoring.

Super User

what current formulas do you have placed in the screen you want the final calculations on, and what are they returning vs what you had expected

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Post Prodigy

Right now, the formulas I have in place are on the following screen (Chronic Condition Mgmt)

Chronic Condition Mgmt / Category score

``Text(Sum(Gallery1.AllItems,TextInput2)/CountRows(Gallery1.AllItems)*100,"#%")``

Chronic Condition Mgmt / Weighted score:

``Sum(txtTCMWeighted,txtAcuteWeighted,txtHealthWeighted)``

Chronic Condition Mgmt / Cumulative score:

``Sum(txtTCMCumulative,txtAcuteCumulative,txtHealthCumulative)``

I just need to know if there is a better way to calculate across screens.

Super User
``Sum(txtTCMCumulative,txtAcuteCumulative,txtHealthCumulative)``

these  txtTCMCumulative etc, are they variables from a Set(txtTCMCumulative, vvalue) somewhere else in the app?

Honestly if only ever working on one report at a time, i personally would probably store all the scores in a local collection, where everytime i add or chaneg a score it removes the old one of it from my collection and updates it score

eveyrtime a new report starts clear the collection then

like Collect(ReportTotals,{QuestionNumber:NameOfYourControl, Type: CCM(etc),Score:numnber between 1 & 100}) eveyr time you set a score, and first doa  check that if countrows(filter(reporttotals,questionnumebr=thisquestion))=0,do the collect, remove this then do the collect) make sense? then at end all your score checks can just add divide etc based on a simple filter of the collection for the type being looked at in that control

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Post Prodigy

Thank you @TheRobRush Let me give it a try and circle back later today or tomorrow with the results.

Announcements