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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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