cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vikna
Helper III
Helper III

Setting a threshold to change colour

My app is as below.

I want the fill colour to change to RED or YELLOW based on the number shown in "TOTAL" in this gallery called "LAPTOP".

 

vikna_5-1625214564977.png

 

The threshold for the colour change can be defined in another gallery called "THRESHOLD FOR LAPTOP"

vikna_4-1625214485986.png

 

I tried the below code and placed under 'Fill' for "TOTAL"

 

vikna_0-1625214271841.png

 

It seems to work but it for the 3rd and 4th line (Zbook G5) it does not read the data from ZBook's threshold which is supposed to be 4 (Red) and 6(Yellow). Instead its taking the data from Elitebook 830 which is 16(YELLOW) and 8(RED).

 

How do I fix this?

Thank you for the advices!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
VenuRebbala
New Member

Assuming that the Low and Critical Values of "THRESHOLD FOR LAPTOP" Gallery vary based on the Location.

It is best to add 2 more label controls to get low and critical values into the laptop gallery and hide them.

 

Add the below 2 label controls and set their VISIBLE property to false

 

 

LabelControl1.Text = LookUp("THRESHOLD FOR LAPTOP" Gallery datasource, Location= ThisItem.Location && Model= ThisItem.Model, Low)

 LabelControl2.Text = LookUp("THRESHOLD FOR LAPTOP" Gallery datasource, Location= ThisItem.Location && Model= ThisItem.Model, Critical)

 

 

 

and then use the below formula in FILL property of Total controlbox as required

 

 

If ( Value(Total.Text) > Value(LabelControl2.Text) && Value(Total.Text) <= Value(LabelControl1.Text), RGBA(255, 226, 98, 100),

If ( Value(Total.Text) <= Value(LabelControl2.Text), RGBA(254, 83, 83, 100), .........

 

 

View solution in original post

2 REPLIES 2
VenuRebbala
New Member

Assuming that the Low and Critical Values of "THRESHOLD FOR LAPTOP" Gallery vary based on the Location.

It is best to add 2 more label controls to get low and critical values into the laptop gallery and hide them.

 

Add the below 2 label controls and set their VISIBLE property to false

 

 

LabelControl1.Text = LookUp("THRESHOLD FOR LAPTOP" Gallery datasource, Location= ThisItem.Location && Model= ThisItem.Model, Low)

 LabelControl2.Text = LookUp("THRESHOLD FOR LAPTOP" Gallery datasource, Location= ThisItem.Location && Model= ThisItem.Model, Critical)

 

 

 

and then use the below formula in FILL property of Total controlbox as required

 

 

If ( Value(Total.Text) > Value(LabelControl2.Text) && Value(Total.Text) <= Value(LabelControl1.Text), RGBA(255, 226, 98, 100),

If ( Value(Total.Text) <= Value(LabelControl2.Text), RGBA(254, 83, 83, 100), .........

 

 

View solution in original post

Thank you very much!

this solved my issue. really appreciate it.

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,049)