cancel
Showing results for
Did you mean:
Helper I

## checkbox

how do i have a lable show the total number of checkboxs ticked

so if 3 out of 5 checkbox values are true the lable equals 3

if 5 checkbox values are true then the label equals 5

14 REPLIES 14
Resident Rockstar
Read all my posts and think for yourself, you will manage then to find your solution.

Hint: you replace value
Helper I

@KroonOfficeSol wrote:
Read all my posts and think for yourself, you will manage then to find your solution.

Hint: you replace value

sorry dont get it - replace value with what ?

Anonymous
Not applicable

@bongobus1 wrote:

@mr-dang wrote:

There's a few ways to do this.

We already have the sum of the checkboxes in Label1.

If we want the color of the text to change to red, you would go to the Color property of Label1 and place a condition:

`If(Value(Label1.Text)>=9, Red, Black)`

This means, "If the value of Label1 is greater than or equal to 9, then make the text color red, otherwise black."

So the If statement works very similarly to Excel.

yep that worked nicely i used a circle to fill the color based on the label value

now to tweek

if the value is between 0 and 7 - fill green

8 to 13 - yellow

14 - 20 red

how is this acheived ?

```If(Value(Label1.Text)>=0 And Value(Label1.Text) <= 7,
Green,
If(Value(Label1.Text) >=8 And Value(Label1.Text) <=13,
Yellow,
If(Value(Label1.Text)>=14 And Value(Label1.Text) <=20,
Red,
Black
)
)
)```
Community Champion

You can take @Anonymous's solution one step further. In PowerApps, you do not need to nest If statements. Instead you can write each condition in a series:

```If(Value(Label1.Text)>=0 And Value(Label1.Text)<= 7,
Green,

Value(Label1.Text)>=8 And Value(Label1.Text)<=13,
Yellow,

Value(Label1.Text)>=14 And Value(Label1.Text)<=20,
Red,

Black
)```

This means, "If the sum is between 0 and 7, make it green. If not, check the next condition and if that's true, make it yellow. Continue to check each condition and if nothing checks out, make it black."

You can have as many conditions and results as you want separated by commas. And then you can end with one 'else' value.

Microsoft Employee
@8bitclassroom
Anonymous
Not applicable

As yes forgot about that. Thanks @mr-dang.

Announcements

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Our team will be reviewing posts using the new "Copilot" label to ensure we highlight and amplify the most relevant and recent content, so you're assured of high-quality content every time you visit. If you share a post that gets featured in the curated gallery, you'll get a PM in the Community to let you know!The curated gallery is ready for you to experience now, so visit the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community. We can't wait to see what you "cook" up!