cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bergh
Helper I
Helper I

Calculate colours

I have 20 boxes that I need to compile into totals for different colors. It looks like the picture, there is Green, Yellow, Red and Double Red. How should I be able to check which box one has written in and then take the sum from the right box? In this case
there should be Green 4 and yellow 2.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Z_Lukowski
Resolver II
Resolver II

Hello,

So I assume you have some kind of condition to format the fields acordingly,

For Example if I have a Number Column "ID" in a table with values [1,2,3,4] and I have a box which for each record I format FIll property like this:

Switch(ThisItem.ID, 1, Red,2,Yellow,3,Green,4,DoubleRed( probably need RGB values here),White);

Then to sum up each Color you can use CountRows(YourGalleryName, ID =1) /for red

or CountRows(YourGalleryName, ID =2) /for Green  etc.

If you want to make this more automatic, you can use a separate Collection to grab distinct ID and then addcolumn to countrows, look at screenshot

Z_Lukowski_0-1670257322396.png

 

And If You have a sum then for each color you can do something like this:-

ForAll(Distinct(colColorsAndID,ID),Sum(Filter(colColorsAndID,ThisRecord.ID=1),YourNumericalValue) <--this can sum the values of your records based on color ID, then you would need to push that to any collection or Label or whatever is in your screenshot 🙂

 

View solution in original post

2 REPLIES 2
Z_Lukowski
Resolver II
Resolver II

Hello,

So I assume you have some kind of condition to format the fields acordingly,

For Example if I have a Number Column "ID" in a table with values [1,2,3,4] and I have a box which for each record I format FIll property like this:

Switch(ThisItem.ID, 1, Red,2,Yellow,3,Green,4,DoubleRed( probably need RGB values here),White);

Then to sum up each Color you can use CountRows(YourGalleryName, ID =1) /for red

or CountRows(YourGalleryName, ID =2) /for Green  etc.

If you want to make this more automatic, you can use a separate Collection to grab distinct ID and then addcolumn to countrows, look at screenshot

Z_Lukowski_0-1670257322396.png

 

And If You have a sum then for each color you can do something like this:-

ForAll(Distinct(colColorsAndID,ID),Sum(Filter(colColorsAndID,ThisRecord.ID=1),YourNumericalValue) <--this can sum the values of your records based on color ID, then you would need to push that to any collection or Label or whatever is in your screenshot 🙂

 

Hi,
The first thing I do is to put in a number (secounds) and then i  divide to get a precentage, after that I some IF's that is makeing  the number. IF < 30% then1, >30 or >60 then2 and >60% then 3. And on top of that  I have the colours. So I have to know if it's Green,yellow, red och double red and then the value, 1,2 or 3. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Community Call Conversations

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 Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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