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
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 (2,257)