cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Change color depending on the count

Hello,

 

In a previous topic I got a code:

 

 

"Total Amount of Propositions: " & 
With(
{wZone:IdeaBox_1}; 
CountRows(wZone)
)

 

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?

17 REPLIES 17

What data type does the Label contain? Which property are you changing - Color, Fill etc

@leyburn19 

This label contains this:

 

"Total Amount of Propositions: " & 
With(
{wZone:IdeaBox_1}; 
CountRows(wZone)
)

 

a formula to count.

I update Color section with your formula.

Then you should reference the field that has the total. 

if(whatevertthatlabelis<0;Red;White)

 

@leyburn19 

Not working. It expect number.

Can you screenshot the label ans the basis fro which you want it to be red or white.  I am assuming there is some sort of total that it can use for the color.

 

What is your  ideabox_1?  Is that the source?

 

 

Then the color property my work as:

 

If(CountRows(ideasbox_1)<0,Red,White)

Ok. I send a wrong script. My bad:

 

 With(
   {
      wSubmitted:
      Filter(
         IdeaBox_1.Utworzony; 
         IsToday(Utworzony)
      )
   };
   CountRows(wSubmitted)
)

 

I use this function to show how many propositions were made today.

It just shows the number - when someone send a sharepoint form it add a new number, and reset each new day.

I want to make it change color depending on how many propositions were made this day.

 

For example 10 propositions were made, "omg" that's a lot let's show some red so people will notice.

 

IdeaBox_1 is my data source (sharepoint list), but if I use it the way you gave me it will count only total.

 

If(CountRows(Filter(Sort(Ideabox_1,ID,Descending),??????)>0,Red,White))

 

??? would equal the formula to filter the list EG: Date=Today() And Column? = 10

 

The sort reverse teh Source list so that Today is likely to be in teh group.  Dates are not delegable,  but this should make it work

 

 

I could not solve this issue, but I gave you thumbs up for your help.

I decided to have a white static label, since working out this dynamic red label was too hard for me.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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