web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formula to Count Selec...
Power Apps
Unanswered

Formula to Count Selected Cells

(0) ShareShare
ReportReport
Posted on by 39

Hi,

 

So I am wondering is the following achievable,

I have set of data which looks like this

3010123
3210000
0200000
3210003
3010123
0000003
3010120

Total: 6

 

The user than selects a cell from each row

I than need each of those selected cells in each row to be calculated to give a total score

 

In the example above (the red highlighted cells would equal 6) however this figure could than vary based on the selected cell in each row changing

 

Is there a formula available that would allow for the total value to adjust based on the selected cells from each row

 

App is built in canvas

 

Hope that make sense.

 

Thank you for you assistance

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @AzJackson 

    How are you currently accomplishing the selection of cells for each row in PowerApps?  This would impact the solution.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • AzJackson Profile Picture
    39 on at

    Currently I have not set this up as was not to sure where to start.

    Open to suggestions

  • v-yutliu-msft Profile Picture
    on at

    Hi @AzJackson ,

    Do you mean that:

    1)you will select one field in each row?

    2)you want to calculate the sum of the selected fields?

    Could you tell me whether these fields are number type?
    I assume that yes.

    I suggest you use collection and gallery in your issue.

    I've made a similar test for your reference:

    1)set the app's OnStart:

     

    ClearCollect(test,AddColumns(datasourcename,"selectedvalue",0))
    //add a column to record the selected value

     

    2)insert a gallery to display the table

    set the gallery's Items:

     

    test

     

    insert multiple labels inside the gallery to display the fields 

    set their Text like this:

     

    ThisItem.fieldname

     

    3)in my test, these fields named Title1,Title2,Title3,Title4,Title5,Title6,Title7

    set Title1's OnSelect:

     

    Patch(test,ThisItem,{selectedvalue:Value(Title1.Text)})

     

    set Title2's OnSelect:

     

     

    Patch(test,ThisItem,{selectedvalue:Value(Title2.Text)})

     

    Others are similar.

    Then the selectedvalue field will be filled in the selected labels' data.

    4)set Title1's Color:

     

    If(ThisItem.selectedvalue=Value(Title1.Text),Red,Black)

     

     

    set Title2's Color:

     

     

    If(ThisItem.selectedvalue=Value(Title2.Text),Red,Black)

     

     

    Others are similar.

    Then only the selected field will be red.

    5)insert a label to display the result, set the label's Text:

     

    Sum(test,selectedvalue)

     

    This will be the result that you want.

     

    7281.PNG

     

    7282.PNG

     

    7283.PNG

     

     

     

    Best regards,

  • AzJackson Profile Picture
    39 on at

    Hi,

     

    Yes thee user will select one cell from each row and yes I would like to calculate the total sum of the selected cells

     

    Can I build this without it being linked to a data source / data connection and use just the data inputs from within the app?

    as the outputs do not need to be stored it just needs to be a "calculator" type function

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard