cancel
Showing results for
Did you mean:
Helper III

## Calculate certain value

I have multiple columns ( Maths, English, Science) the choice are E,G,I,U

i now want to be able to calculate how many U's have been selected from the multiple choice columns (for this row of data)

i would have a multiple labels that show the calculated values for example

E=3
G=1
I=1

U=0

i was hoping for somthing like this?

Sum(Tracker_FullData,ThisItem.Art_engagement.Value="G"+ThisItem.Eng_engagement.Value="G")

but as the values are letters this wont work?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support

Are you using a table or a Gallery? What is your datasource?

I assume that you are using a gallery to display records from a SP list. If you have a countable number of Choice columns, you can try my method:

1. I create a list called “count1” with a “Title” column and 6 Choice columns(their choice are E,G,I,U):

2. Go to my app, add a button into the gallery, set its OnSelect property to(use four variables to calculate):

``````Set(E,0);
Set(G,0);
Set(I,0);
Set(U,0);
Switch(ThisItem.Drama.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.'D&T'.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.English.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.EngLit.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.EarlyYears.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.French.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.'Food Tech'.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1))``````

3. Add four labels inside/outside the gallery, then set their Text property to the four variable names in turn:

If you want to see the calculated values of one item, just click the button beside this item, then you can check results like below(in my test, I add another four labels to show “E=”,”G=”,”I=”,”U=”):

Best Regards,

Allen

3 REPLIES 3
Helper III

Anyone?

Super User

if count, what column and also is the table connected to a Gallery

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Community Support

Are you using a table or a Gallery? What is your datasource?

I assume that you are using a gallery to display records from a SP list. If you have a countable number of Choice columns, you can try my method:

1. I create a list called “count1” with a “Title” column and 6 Choice columns(their choice are E,G,I,U):

2. Go to my app, add a button into the gallery, set its OnSelect property to(use four variables to calculate):

``````Set(E,0);
Set(G,0);
Set(I,0);
Set(U,0);
Switch(ThisItem.Drama.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.'D&T'.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.English.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.EngLit.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.EarlyYears.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.French.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1));
Switch(ThisItem.'Food Tech'.Value,"E",Set(E,E+1),"G",Set(G,G+1),"I",Set(I,I+1),"U",Set(U,U+1))``````

3. Add four labels inside/outside the gallery, then set their Text property to the four variable names in turn:

If you want to see the calculated values of one item, just click the button beside this item, then you can check results like below(in my test, I add another four labels to show “E=”,”G=”,”I=”,”U=”):

Best Regards,

Allen

Announcements

#### Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

#### Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

#### Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,299)