Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy

Change color depending on the count



In a previous topic I got a code:



"Total Amount of Propositions: " & 


This sums up all my Sharepoint list records and print it, so the users can see that there are propositions.


Is it possible to make this code change Color depending on the amount that CountRows(wZone provide)?


I tried to edit color section, but it didn't work. I have no Ide how to link a CountRows wZone with a Color.

I would love to have default color for value - 0 white, and every other value light red.


Is it possible to make in such a scenario?

Memorable Member
Memorable Member

In the color property put something like;


If(CountRows(wZone)=?,Black,If(CountRows(wZone) <0, Red, If(CountRows(wZone)=?,Blue)))


The above will change teh text Color based on results you want.  Just edit them


I use ; as delimiter.

This function does not work:


If(CountRows(wZone)=0;White;If(CountRows(wZone) <0; Red))

I placed in in the Color section, and I am receiving such an errors:

Name is invalid

Function CountRows does have invalid arguments.


can you do a screen shot of your "color section"


Maybe wZone isn't recognized because it does not exist? It is created solely for the count formula? 



Translation: Function CountRows does have an invalid arguments.

Name is invalid. ID was not recognized.




Sorry,  I thought wZone was teh data source.  Replace it with the name of teh SP list you want to count

Ok,  my fault.  you want the Total column field be a different color based on value. Then you could try:




Sumfield is the nam eof teh Textinputbox or Label you are using to sum the Column.  

It works. Thanks.

Is it possible to change a color only of the value of this label, not whole label?

"List of propositions made today: " & 

I would love to have only number condtionally in Red, and "List of propositions" in white always.

Or should I create two labels - one with number, and other with name "List of propositions"

Should be the same with all labels and controls.  You can change fill, borders etc

After more tests I believe that this does not work...



No matter the Value in Label6_1 the color is always White.

When I change the formula to White;Red the color is always Red. 

Helpful resources

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,284)